Skip to content

Instantly share code, notes, and snippets.

@hugithordarson
Created December 11, 2013 22:43
Show Gist options
  • Save hugithordarson/7919872 to your computer and use it in GitHub Desktop.
Save hugithordarson/7919872 to your computer and use it in GitHub Desktop.
private static NSArray<Integer> jobLineIDsWithOrphans( EOEditingContext ec, String companyNumber, Integer customerID ) {
NSMutableArray<EOQualifier> a = new NSMutableArray<>();
if( companyNumber != null ) {
a.addObject( JoblineOrphan.COMPANY_NUMBER.eq( companyNumber ) );
}
if( customerID != null ) {
a.addObject( JoblineOrphan.CUSTOMER_ID.eq( customerID ) );
}
EOAndQualifier q = new EOAndQualifier( a );
EOFetchSpecification fs = new EOFetchSpecification( JoblineOrphan.ENTITY_NAME, q, null );
fs.setFetchesRawRows( true );
fs.setRawRowKeyPaths( new NSArray<>( "jobLineID" ) );
NSArray<NSDictionary> fetched = ec.objectsWithFetchSpecification( fs );
return (NSArray<Integer>)fetched.valueForKey( "jobLineID" );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment