/** * Retrieve objects using a qualifier and sort orderings. * * @param context The editing context to use * @param qualifier The qualifier to use * @param sortOrderings The sort orderings to use * @return an NSArray of the entities retrieved */ public static NSArray<UserMessageSubscription> objectsMatchingQualifier( EOEditingContext context, EOQualifier qualifier, NSArray<EOSortOrdering> sortOrderings) { @SuppressWarnings("unchecked") EOFetchSpecification fspec = new WCFetchSpecification(ENTITY_NAME, qualifier, sortOrderings); fspec.setUsesDistinct(true); return objectsWithFetchSpecification(context, fspec); }
public static NSArray fetchAll( EOEditingContext editingContext, EOQualifier qualifier, NSArray sortOrderings, boolean distinct, int fetchLimit, DTEOEditingContextHandler handler) { EOFetchSpecification fetchSpec = new EOFetchSpecification(ENTITY_NAME, qualifier, sortOrderings); fetchSpec.setIsDeep(true); fetchSpec.setUsesDistinct(distinct); fetchSpec.setFetchLimit(fetchLimit); if (handler != null) { fetchSpec.setPromptsAfterFetchLimit(true); editingContext.setMessageHandler(handler); } return (NSArray) editingContext.objectsWithFetchSpecification(fetchSpec); }