
Static Public Member Functions | |
| static Object | _aggregateFunctionWithQualifier (EOEditingContext ec, String entityName, String attributeName, String function, Class valueClass, String valueType, EOQualifier qualifier) |
| static Object | _aggregateFunctionWithQualifierAndAggregateAttribute (EOEditingContext ec, String entityName, EOQualifier qualifier, EOAttribute aggregateAttribute) |
| static String | _stringForPrimaryKey (Object pk) |
| static void | addObjectToObjectOnBothSidesOfRelationshipWithKey (EOEnterpriseObject addedObject, EOEnterpriseObject referenceObject, String key) |
| static Number | aggregateFunctionWithQualifier (EOEditingContext ec, String entityName, String attributeName, String function, EOQualifier qualifier) |
| static Number | aggregateFunctionWithQualifier (EOEditingContext ec, String entityName, String attributeName, String function, String fetchSpecificationName, NSDictionary bindings) |
| static NSTimestamp | aggregateTimestampWithQualifier (EOEditingContext ec, String entityName, String attributeName, String function, EOQualifier qualifier) |
| static EOQualifier | andQualifier (EOQualifier q1, EOQualifier q2) |
| static NSArray | arrayFromDataSource (EODataSource dataSource) |
| static NSDictionary< String, Integer > | changedRegisteredObjectCount (NSDictionary< String, Integer > currentCounts, NSDictionary< String, Integer > oldCounts) |
| static void | clearSnapshotForRelationshipNamed (EOEnterpriseObject eo, String relationshipName) |
| static void | clearSnapshotForRelationshipNamedInDatabase (EOEnterpriseObject eo, String relationshipName, EODatabase database) |
| static Object | convertEOtoGID (Object obj) |
| static Object | convertGIDtoEO (EOEditingContext editingContext, Object obj) |
| static EOEnterpriseObject | createAndAddObjectToRelationship (EOEditingContext editingContext, EOEnterpriseObject source, String relationshipName, String destinationEntityName, NSDictionary objectInfo) |
| static EOEnterpriseObject | createAndInsertObject (EOEditingContext editingContext, String entityName, NSDictionary objectInfo) |
| static EOEnterpriseObject | createAndInsertObject (EOEditingContext editingContext, String entityName) |
| static < TextendsEOEnterpriseObject > T | createAndInsertObject (EOEditingContext ec, Class< T > eoClass) |
| static EOArrayDataSource | dataSourceForArray (EOEditingContext ec, String entityName, NSArray array) |
| static EOArrayDataSource | dataSourceForArray (NSArray<?extends EOEnterpriseObject > array) |
| static EODetailDataSource | dataSourceForObjectAndKey (EOEnterpriseObject object, String key) |
| static NSMutableArray | deletedObjects (EOEditingContext editingContext, NSArray< String > entityNames, EOQualifier qualifier) |
| static String | destinationEntityNameForKeyPath (EOEnterpriseObject eo, String keyPath) |
| static< T > NSArray< T > | distinctValuesForKeyPath (EOEditingContext editingContext, String entityName, String keyPath, EOQualifier qualifier, NSArray< EOSortOrdering > sortOrderings) |
| static < TextendsEOEnterpriseObject > T | editableInstanceOfObject (T eo, boolean createNestedContext) |
| static boolean | eoEquals (EOEnterpriseObject firstEO, EOEnterpriseObject secondEO) |
| static NSArray | faultsForGlobalIDs (EOEditingContext ec, NSArray gids) |
| static NSArray | faultsForRawRowsFromEntity (EOEditingContext ec, NSArray primKeys, String entityName) |
| static EOFetchSpecification | fetchSpecificationNamedWithBindings (String entityName, String fetchSpecificationName, NSDictionary bindings) |
| static NSArray | filteredObjectsWithQualifier (EOEditingContext editingContext, NSArray objectsToFilter, String entityName, EOQualifier qualifier, NSArray sortOrderings, boolean usesDistinct, boolean isDeep, boolean includeNewObjects, boolean includeNewObjectsInParentEditingContext, boolean filterUpdatedObjects, boolean removeDeletedObjects) |
| static EOGlobalID | globalIDForString (EOEditingContext ec, String entityName, String string) |
| static NSArray | globalIDsForObjects (NSArray eos) |
| static NSMutableArray | insertedObjects (EOEditingContext editingContext, NSArray< String > entityNames, EOQualifier qualifier) |
| static boolean | isNewObject (EOEnterpriseObject eo) |
| static < TextendsEOEnterpriseObject > T | localInstanceOfObject (EOEditingContext ec, T eo) |
| static EOQualifier | localInstancesInQualifier (EOEditingContext ec, EOQualifier q) |
| static < TextendsEOEnterpriseObject > NSArray< T > | localInstancesOfObjects (EOEditingContext ec, NSArray< T > eos) |
| static void | makeQualifierTrue (EOQualifier qualifier, Object obj) |
| static NSDictionary< String, Object > | newPrimaryKeyDictionaryForEntityNamed (EOEditingContext ec, String entityName) |
| static NSDictionary< String, Object > | newPrimaryKeyDictionaryForObject (EOEnterpriseObject eo) |
| static NSDictionary< String, Object > | newPrimaryKeyDictionaryForObjectFromClassProperties (EOEnterpriseObject eo) |
| static Integer | objectCountUniqueWithQualifierAndAttribute (EOEditingContext ec, String entityName, EOQualifier qualifier, String attributeName) |
| static Integer | objectCountWithQualifier (EOEditingContext ec, String entityName, EOQualifier qualifier) |
| static NSArray | objectsForFaults (EOEditingContext ec, NSArray possibleFaults) |
| static NSArray | objectsForFaultWithSortOrderings (EOEditingContext ec, NSArray possibleFaults, NSArray sortOrderings) |
| static NSArray | objectsForGlobalIDs (final EOEditingContext ec, final NSArray globalIDs) |
| static < TextendsEOEnterpriseObject > NSArray< T > | objectsInRange (EOEditingContext ec, EOFetchSpecification spec, int start, int end, boolean rawRowsForCustomQueries) |
| static < TextendsEOEnterpriseObject > NSArray< T > | objectsInRange (EOEditingContext ec, EOFetchSpecification spec, int start, int end) |
| static NSArray | objectsWithQualifier (EOEditingContext editingContext, String entityName, EOQualifier qualifier, NSArray prefetchKeyPaths, NSArray sortOrderings, int fetchLimit, boolean usesDistinct, boolean isDeep, NSDictionary hints, boolean includeNewObjects, boolean includeNewObjectsInParentEditingContext, boolean filterUpdatedObjects, boolean removeDeletedObjects) |
| static NSArray | objectsWithQualifier (EOEditingContext editingContext, String entityName, EOQualifier qualifier, NSArray prefetchKeyPaths, NSArray sortOrderings, boolean usesDistinct, boolean isDeep, NSDictionary hints, boolean includeNewObjects, boolean includeNewObjectsInParentEditingContext, boolean filterUpdatedObjects, boolean removeDeletedObjects) |
| static NSArray | objectsWithQualifier (EOEditingContext editingContext, String entityName, EOQualifier qualifier, NSArray prefetchKeyPaths, boolean includeNewObjects, boolean includeNewObjectsInParentEditingContext, boolean filterUpdatedObjects, boolean removeDeletedObjects) |
| static NSArray | objectsWithQualifier (EOEditingContext _editingContext, String _entityName, EOQualifier _qualifier, NSArray _prefetchKeyPaths, boolean _includeNewObjects, boolean _includeNewObjectsInParentEditingContext) |
| static NSArray | objectsWithQualifier (EOEditingContext ec, String entityName, EOQualifier qualifier, NSArray prefetchKeyPaths, boolean includeNewObjects) |
| static NSArray | objectsWithQualifierFormat (EOEditingContext ec, String entityName, String qualifierFormat, NSArray args, NSArray prefetchKeyPaths, boolean includeNewObjects, boolean includeNewObjectsInParentEditingContexts) |
| static NSArray | objectsWithQualifierFormat (EOEditingContext ec, String entityName, String qualifierFormat, NSArray args, NSArray prefetchKeyPaths, boolean includeNewObjects) |
| static EOEnterpriseObject | objectWithPrimaryKeyValue (EOEditingContext ec, String entityName, Object primaryKeyValue, NSArray prefetchingKeyPaths, boolean refreshRefetchedObjects) |
| static EOEnterpriseObject | objectWithPrimaryKeyValue (EOEditingContext ec, String entityName, Object primaryKeyValue, NSArray prefetchingKeyPaths) |
| static EOEnterpriseObject | objectWithQualifier (EOEditingContext editingContext, String entityName, EOQualifier qualifier) |
| static EOQualifier | orQualifier (EOQualifier q1, EOQualifier q2) |
| static EOQualifier | orQualifierForKeyPaths (NSArray keyPaths, NSSelector selector, NSArray values) |
| static EOQualifier | orQualifierForKeyPaths (NSArray keyPaths, NSSelector selector, Object value) |
| static NSArray | primaryKeyArrayForObject (EOEnterpriseObject obj) |
| static NSDictionary< String, Object > | primaryKeyDictionaryForString (EOEditingContext ec, String entityName, String string) |
| static EOFetchSpecification | primaryKeyFetchSpecificationForEntity (EOEditingContext ec, String entityName, EOQualifier eoqualifier, NSArray< EOSortOrdering > sortOrderings, NSArray< String > additionalKeys) |
| static Object | primaryKeyObjectForObject (EOEnterpriseObject eo) |
| static NSArray | primaryKeysMatchingQualifier (EOEditingContext ec, String entityName, EOQualifier eoqualifier, NSArray< EOSortOrdering > sortOrderings) |
| static String | primaryKeyStringForGlobalID (EOKeyGlobalID gid) |
| static String | primaryKeyStringForObject (EOEnterpriseObject eo) |
| static NSArray | primaryKeyValuesInRange (EOEditingContext ec, EOFetchSpecification spec, int start, int end) |
| static EOQualifier | qualifierMatchingAnyKey (NSArray keys, NSSelector selector, Object value) |
| static void | refaultObject (EOEnterpriseObject eo) |
| static NSDictionary< String, Integer > | registeredObjectCount (EOEditingContext ec) |
| static EOEnterpriseObject | requiredObjectWithQualifier (EOEditingContext editingContext, String entityName, EOQualifier qualifier) |
| static EOEntity | rootEntity (EOEnterpriseObject eo) |
| static String | rootEntityName (EOEnterpriseObject eo) |
| static EOFetchSpecification | schemaBasedFetchSpecification (EOEditingContext ec, EOFetchSpecification fetchSpecification) |
| static EOQualifier | schemaBasedQualifier (EOEditingContext ec, String entityName, EOQualifier qualifier) |
| static EOEnterpriseObject | sharedObjectMatchingKeyAndValue (String entityName, String key, Object value) |
| static NSArray | sharedObjectsForEntityNamed (String entityName) |
| static NSArray | sharedObjectsMatchingKeyAndValue (String entityName, String key, Object value) |
| static NSArray | sharedObjectsWithFetchSpecificationNamed (String entityName, String fetchSpecName) |
| static EOEnterpriseObject | sharedObjectWithFetchSpec (String entityName, String fetchSpec) |
| static EOEnterpriseObject | sharedObjectWithPrimaryKey (String entityName, Object primaryKey) |
| static synchronized NSArray | stringAttributeListForEntityNamed (EOEditingContext ec, String entityName) |
| static void | trimSpaces (EOEnterpriseObject object) |
| static NSMutableArray | updatedObjects (EOEditingContext editingContext, NSArray< String > entityNames, EOQualifier qualifier) |
| static void | validateUniquenessOf (String entityName, EOEnterpriseObject eo, String...keys) |
| static void | validateUniquenessOf (EOEnterpriseObject eo, String...keys) |
| static void | validateUniquenessOf (EOEnterpriseObject eo, EOQualifier restrictingQualifier, String...keys) |
| static void | validateUniquenessOf (String entityName, EOEnterpriseObject eo, EOQualifier restrictingQualifier, String...keys) |
Static Public Attributes | |
| static final Logger | log = Logger.getLogger(ERXEOControlUtilities.class) |
Static Private Member Functions | |
| static Object | __aggregateFunctionWithQualifierAndAggregateAttribute (EODatabaseContext databaseContext, EOEditingContext ec, String entityName, EOQualifier qualifier, EOAttribute aggregateAttribute) |
| static void | ensureSortOrdering (EOEditingContext ec, NSArray<?extends EOGlobalID > gids, NSMutableArray<?extends EOEnterpriseObject > objects) |
Static Private Attributes | |
| static NSMutableDictionary | _attributeKeysPerEntityName = new NSMutableDictionary() |
EOControl provides infrastructure for creating and managing enterprise objects.
| static Object __aggregateFunctionWithQualifierAndAggregateAttribute | ( | EODatabaseContext | databaseContext, | |
| EOEditingContext | ec, | |||
| String | entityName, | |||
| EOQualifier | qualifier, | |||
| EOAttribute | aggregateAttribute | |||
| ) | [static, private] |
| static Object _aggregateFunctionWithQualifier | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| String | attributeName, | |||
| String | function, | |||
| Class | valueClass, | |||
| String | valueType, | |||
| EOQualifier | qualifier | |||
| ) | [static] |
| static Object _aggregateFunctionWithQualifierAndAggregateAttribute | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| EOQualifier | qualifier, | |||
| EOAttribute | aggregateAttribute | |||
| ) | [static] |
Returns the number of objects in the database with the qualifier and counting attribute. This implementation queries the database directly without loading the objects into memory.
| ec | the editing context | |
| entityName | the name of the entity | |
| qualifier | the qualifier to filter with | |
| aggregateAttribute | the attribute that contains the "count(*)" definition |
| static String _stringForPrimaryKey | ( | Object | pk | ) | [static] |
Returns the propertylist-encoded string representation of the primary key for a given object. Made public only for ERXGenericRecord.
| pk | the primary key |
| static void addObjectToObjectOnBothSidesOfRelationshipWithKey | ( | EOEnterpriseObject | addedObject, | |
| EOEnterpriseObject | referenceObject, | |||
| String | key | |||
| ) | [static] |
Adds an object to another objects relationship. Has the advantage of ensuring that the added object is in the same editing context as the reference object.
| addedObject | object to be added to the relationship | |
| referenceObject | object that has the relationship | |
| key | relationship key |
| static Number aggregateFunctionWithQualifier | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| String | attributeName, | |||
| String | function, | |||
| EOQualifier | qualifier | |||
| ) | [static] |
Computes an aggregate function for a given attribute restricted by a given qualifier. For instance select MAX(AGE) from User where name like 'M*'
| ec | editing context used for the fetch | |
| entityName | name of the entity | |
| attributeName | attribute for the function to be performed on | |
| function | name, ie MAX, MIN, AVG, etc. | |
| qualifier | to restrict data set |
| static Number aggregateFunctionWithQualifier | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| String | attributeName, | |||
| String | function, | |||
| String | fetchSpecificationName, | |||
| NSDictionary | bindings | |||
| ) | [static] |
Computes an aggregate function for a given attribute restricted by a given qualifier. For instance select MAX(AGE) from User where name like 'M*'
| ec | editing context used for the fetch | |
| entityName | name of the entity | |
| attributeName | attribute for the function to be performed on | |
| function | name, ie MAX, MIN, AVG, etc. |
| static NSTimestamp aggregateTimestampWithQualifier | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| String | attributeName, | |||
| String | function, | |||
| EOQualifier | qualifier | |||
| ) | [static] |
Computes an aggregate function for a given attribute restricted by a given qualifier. For instance select MAX(AGE) from User where name like 'M*'
| ec | editing context used for the fetch | |
| entityName | name of the entity | |
| attributeName | attribute for the function to be performed on | |
| function | name, ie MAX, MIN, AVG, etc. | |
| qualifier | to restrict data set |
| static EOQualifier andQualifier | ( | EOQualifier | q1, | |
| EOQualifier | q2 | |||
| ) | [static] |
Joins the given qualifiers with an AND. One or both arguments may be null, if both are null, null is returned.
| q1 | ||
| q2 |
| static NSArray arrayFromDataSource | ( | EODataSource | dataSource | ) | [static] |
Converts a datasource into an array.
| dataSource | data source to be converted |
| static NSDictionary<String, Integer> changedRegisteredObjectCount | ( | NSDictionary< String, Integer > | currentCounts, | |
| NSDictionary< String, Integer > | oldCounts | |||
| ) | [static] |
Returns the changes in count registered objects in the EC grouped by entity name, which is useful for memory debugging.
| currentCounts | current count of objects | |
| oldCounts | previous count of objects |
| static void clearSnapshotForRelationshipNamed | ( | EOEnterpriseObject | eo, | |
| String | relationshipName | |||
| ) | [static] |
Clears snapshot the relaationship of a given enterprise so it will be read again when next accessed.
| eo | enterprise object | |
| relationshipName | relationship name |
| static void clearSnapshotForRelationshipNamedInDatabase | ( | EOEnterpriseObject | eo, | |
| String | relationshipName, | |||
| EODatabase | database | |||
| ) | [static] |
Clears snapshot the relationship of a given enterprise so it will be read again when next accessed.
| eo | enterprise object | |
| relationshipName | relationship name |
| static Object convertEOtoGID | ( | Object | obj | ) | [static] |
Given a dictionary, array, set, EO, etc, this will recursively turn EO's into GID's. You should lock the editingContext before calling this.
| obj | the object to recursively turn EO's into GID's for |
| static Object convertGIDtoEO | ( | EOEditingContext | editingContext, | |
| Object | obj | |||
| ) | [static] |
Given a dictionary, array, set, EO, etc, this will recursively turn GID's into EO's. You should lock the editingContext before calling this.
| obj | the object to recursively turn GID's into EO's for |
| static EOEnterpriseObject createAndAddObjectToRelationship | ( | EOEditingContext | editingContext, | |
| EOEnterpriseObject | source, | |||
| String | relationshipName, | |||
| String | destinationEntityName, | |||
| NSDictionary | objectInfo | |||
| ) | [static] |
Creates an object using the utility method createEO from this utility class. After creating the enterprise object it is added to the relationship of the enterprise object passed in. For instance:
createAndAddObjectToRelationship(ec, foo, "toBars", "Bar", dictValues);
will create an instance of Bar, set all of the key-value pairs from the dictValues dictionary, insert it into an editing context and then add it to both sides of the realtionship "toBars" off of the enterprise object foo.
| editingContext | editing context to create the object in | |
| source | enterprise object to whose relationship the newly created object will be added. | |
| relationshipName | relationship name of the enterprise object that is passed in to which the newly created eo should be added. | |
| destinationEntityName | name of the entity of the object to be created. | |
| objectInfo | dictionary of values to be set on the newly created object before it is inserted into the editing context. |
| static EOEnterpriseObject createAndInsertObject | ( | EOEditingContext | editingContext, | |
| String | entityName, | |||
| NSDictionary | objectInfo | |||
| ) | [static] |
Creates an enterprise object for the given entity name by first looking up the class description of the entity to create the enterprise object. The object is then inserted into the editing context and returned.
| editingContext | editingContext to insert the created object into | |
| entityName | name of the entity to be created. | |
| objectInfo | dictionary of values pushed onto the object before being inserted into the editing context. |
| static EOEnterpriseObject createAndInsertObject | ( | EOEditingContext | editingContext, | |
| String | entityName | |||
| ) | [static] |
Creates an enterprise object for the given entity name by first looking up the class description of the entity to create the enterprise object. The object is then inserted into the editing context and returned.
| editingContext | editingContext to insert the created object into | |
| entityName | name of the entity to be created. |
| static <TextendsEOEnterpriseObject> T createAndInsertObject | ( | EOEditingContext | ec, | |
| Class< T > | eoClass | |||
| ) | [static] |
Creates an enterprise object for the given entity name by first looking up the class description of the entity to create the enterprise object. The object is then inserted into the editing context and returned.
| <T> | The enterprise object type | |
| ec | editingContext to insert the created object into | |
| eoClass | class of the enterprise object to be created |
| static EOArrayDataSource dataSourceForArray | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| NSArray | array | |||
| ) | [static] |
Simple utility method that will convert an array of enterprise objects into an EOArrayDataSource.
Note that the datasource that is constructed uses the class description and editing context of the first object of the array.
| array | collection of objects to be turned into a datasource |
| static EOArrayDataSource dataSourceForArray | ( | NSArray<?extends EOEnterpriseObject > | array | ) | [static] |
Simple utility method that will convert an array of enterprise objects into an EOArrayDataSource.
Note that the datasource that is constructed uses the class description and editing context of the first object of the array.
| array | collection of objects to be turned into a datasource |
| static EODetailDataSource dataSourceForObjectAndKey | ( | EOEnterpriseObject | object, | |
| String | key | |||
| ) | [static] |
Creates a detail data source for a given enterprise object and a relationship key. These types of datasources can be very handy when you are displaying a list of objects a la D2W style and then some objects are added or removed from the relationship. If an array datasource were used then the list would not reflect the changes made, however the detail data source will reflect changes made to the relationship.
Note: the relationship key does not have to be an eo relationship, instead it just has to return an array of enterprise objects.
| object | that has the relationship | |
| key | relationship key |
| static NSMutableArray deletedObjects | ( | EOEditingContext | editingContext, | |
| NSArray< String > | entityNames, | |||
| EOQualifier | qualifier | |||
| ) | [static] |
| editingContext | the editing context to look in | |
| entityNames | the names of the entity to look for | |
| qualifier | the qualifier to restrict by |
Convenience to get the destination entity name from a key path of an object. Returns null if no destination found.
| eo | ||
| keyPath |
| static <T> NSArray<T> distinctValuesForKeyPath | ( | EOEditingContext | editingContext, | |
| String | entityName, | |||
| String | keyPath, | |||
| EOQualifier | qualifier, | |||
| NSArray< EOSortOrdering > | sortOrderings | |||
| ) | [static] |
Returns an NSArray of distinct values available for the given entity and key path. The result can be narrowed by an optional qualifier and optionally sorted with sort orderings
| <T> | type of values for the key path | |
| editingContext | editingContext | |
| entityName | entityName | |
| keyPath | keyPath | |
| qualifier | restricting qualifier (optional) | |
| sortOrderings | sortOrderings to be applied (optional) |
| static <TextendsEOEnterpriseObject> T editableInstanceOfObject | ( | T | eo, | |
| boolean | createNestedContext | |||
| ) | [static] |
Creates a new, editable instance of the supplied object. Takes into account if the object is newly inserted, lives in a shared context and can either create a peer or nested context.
| eo | object for the new instance | |
| createNestedContext | true, if we should create a nested context (otherwise we create a peer context) |
| static void ensureSortOrdering | ( | EOEditingContext | ec, | |
| NSArray<?extends EOGlobalID > | gids, | |||
| NSMutableArray<?extends EOEnterpriseObject > | objects | |||
| ) | [static, private] |
Ensures the array of objects follow the same order than the array of globalIDs returned by the first fetch.
| ec | an editingContext | |
| gids | the array of globalIDs ordered as expected | |
| objects | the array of objects to be ordered based on the array of gids |
| static boolean eoEquals | ( | EOEnterpriseObject | firstEO, | |
| EOEnterpriseObject | secondEO | |||
| ) | [static] |
Determines if two EOs are equal by comparing their EOGlobalIDs. This does not require the two EOs to be in the same EOEditingContext and will be safe when either is or both are null. This does not test the two EOs for content equality.
| firstEO | first EO to compare | |
| secondEO | second EO to compare |
| static NSArray faultsForGlobalIDs | ( | EOEditingContext | ec, | |
| NSArray | gids | |||
| ) | [static] |
| static NSArray faultsForRawRowsFromEntity | ( | EOEditingContext | ec, | |
| NSArray | primKeys, | |||
| String | entityName | |||
| ) | [static] |
| static EOFetchSpecification fetchSpecificationNamedWithBindings | ( | String | entityName, | |
| String | fetchSpecificationName, | |||
| NSDictionary | bindings | |||
| ) | [static] |
Gets a fetch specification from a given entity. If qualifier binding variables are passed in then the fetchspecification is cloned and the binding variables are substituted returning a fetch specification that can be used.
| entityName | name of the entity that the fetch specification is bound to | |
| fetchSpecificationName | name of the fetch specification | |
| bindings | dictionary of qualifier bindings |
| static NSArray filteredObjectsWithQualifier | ( | EOEditingContext | editingContext, | |
| NSArray | objectsToFilter, | |||
| String | entityName, | |||
| EOQualifier | qualifier, | |||
| NSArray | sortOrderings, | |||
| boolean | usesDistinct, | |||
| boolean | isDeep, | |||
| boolean | includeNewObjects, | |||
| boolean | includeNewObjectsInParentEditingContext, | |||
| boolean | filterUpdatedObjects, | |||
| boolean | removeDeletedObjects | |||
| ) | [static] |
Utility method used to filter an array of objects given a qualifier. Also has support for filtering the newly inserted, updated, and deleted objects in the passed editing context or any parent editing contexts as well as specifying prefetching key paths. Note that only NEW objects are supported in parent editing contexts.
| editingContext | editing context to fetch it into | |
| objectsToFilter | objects to filter | |
| entityName | name of the entity | |
| qualifier | qualifier | |
| prefetchKeyPaths | prefetching key paths | |
| sortOrderings | the sort orderings to use on the results | |
| fetchLimit | the fetch limit to use | |
| usesDistinct | whether or not to distinct the results | |
| isDeep | whether or not to fetch deeply | |
| hints | fetch hints to apply | |
| includeNewObjects | option to include newly inserted objects in the result set | |
| includeNewObjectsInParentEditingContext | option to include newly inserted objects in parent editing contexts. if true, the editing context lineage is explored, any newly-inserted objects matching the qualifier are collected and faulted down through all parent editing contexts of ec. | |
| filterUpdatedObjects | option to include updated objects that now match the qualifier or remove updated objects thats no longer match the qualifier | |
| removeDeletedObjects | option to remove objects that have been deleted |
| static EOGlobalID globalIDForString | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| String | string | |||
| ) | [static] |
Returns the decoded global id for an propertylist encoded string representation of the primary key for a given object.
| static NSArray globalIDsForObjects | ( | NSArray | eos | ) | [static] |
| static NSMutableArray insertedObjects | ( | EOEditingContext | editingContext, | |
| NSArray< String > | entityNames, | |||
| EOQualifier | qualifier | |||
| ) | [static] |
| editingContext | the editing context to look in | |
| entityNames | the names of the entity to look for | |
| qualifier | the qualifier to restrict by |
| static boolean isNewObject | ( | EOEnterpriseObject | eo | ) | [static] |
Determines if an enterprise object is a new object and hasn't been saved to the database yet.
Note: An object that has been deleted will have it's editing context set to null which means this method would report true for an object that has been deleted from the database.
| eo | enterprise object to check |
| static <TextendsEOEnterpriseObject> T localInstanceOfObject | ( | EOEditingContext | ec, | |
| T | eo | |||
| ) | [static] |
This has one advantage over the standard EOUtilites method of first checking if the editingcontexts are equal before creating a fault for the object in the editing context.
| ec | editing context to get a local instance of the object in | |
| eo | object to get a local copy of |
| static EOQualifier localInstancesInQualifier | ( | EOEditingContext | ec, | |
| EOQualifier | q | |||
| ) | [static] |
faults every EO in the qualifiers into the specified editingContext. This is important for in memory filtering and eo comparision
| ec | ||
| q |
| static <TextendsEOEnterpriseObject> NSArray<T> localInstancesOfObjects | ( | EOEditingContext | ec, | |
| NSArray< T > | eos | |||
| ) | [static] |
Provides the same functionality as the equivalent method in EOUtilities except it will use the localInstanceOfObject method from this utilities class which has a few enhancements.
| ec | editing context to pull local object copies | |
| eos | array of enterprise objects |
| static void makeQualifierTrue | ( | EOQualifier | qualifier, | |
| Object | obj | |||
| ) | [static] |
Given a qualifier of EOAndQualifiers and EOKVQualifiers, make then evaluate to true on the given object.
| qualifier | the qualifier to apply to the object | |
| obj | the object to make qualifier evaluate to true for |
| static NSDictionary<String, Object> newPrimaryKeyDictionaryForEntityNamed | ( | EOEditingContext | ec, | |
| String | entityName | |||
| ) | [static] |
Utility method to generate a new primary key dictionary using the adaptor for a given entity. This is can be handy if you need to have a primary key for an object before it is saved to the database. This method uses the same method that EOF uses by default for generating primary keys. See ERXGeneratesPrimaryKeyInterface for more information about using a newly created dictionary as the primary key for an enterprise object.
| ec | editing context | |
| entityName | name of the entity to generate the primary key dictionary for. |
| static NSDictionary<String, Object> newPrimaryKeyDictionaryForObject | ( | EOEnterpriseObject | eo | ) | [static] |
Utility method to generate a new primary key for an object. Calls newPrimaryKeyForObjectFromClassProperties(EOEnterpriseObject) and if that returns null, newPrimaryKeyDictionaryForEntityNamed(EOEditingContext, String)
| static NSDictionary<String, Object> newPrimaryKeyDictionaryForObjectFromClassProperties | ( | EOEnterpriseObject | eo | ) | [static] |
Utility method to generate a new primary key dictionary using the objects class properties. Use it when your PKs are class properties.
| eo | object in question |
| static Integer objectCountUniqueWithQualifierAndAttribute | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| EOQualifier | qualifier, | |||
| String | attributeName | |||
| ) | [static] |
Returns the number of unique objects matching the given qualifier for a given entity name. Implementation wise this method will generate the correct sql to only perform a count, i.e. all of the objects wouldn't be pulled into memory.
| ec | editing context to use for the count qualification | |
| entityName | name of the entity to fetch | |
| qualifier | to find the matching objects | |
| attributeName | name of attribute in same entity to consider in order to determine uniqueness |
| static Integer objectCountWithQualifier | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| EOQualifier | qualifier | |||
| ) | [static] |
Returns the number of objects matching the given qualifier for a given entity name. Implementation wise this method will generate the correct sql to only perform a count, i.e. all of the objects wouldn't be pulled into memory.
| ec | editing context to use for the count qualification | |
| entityName | name of the entity to fetch | |
| qualifier | to find the matching objects |
| static NSArray objectsForFaults | ( | EOEditingContext | ec, | |
| NSArray | possibleFaults | |||
| ) | [static] |
Triggers all faults in an efficient manner.
| ec | ||
| possibleFaults | globalIDs |
| static NSArray objectsForFaultWithSortOrderings | ( | EOEditingContext | ec, | |
| NSArray | possibleFaults, | |||
| NSArray | sortOrderings | |||
| ) | [static] |
Uses ERXEOControlUtilities.objectForFaults to turn the faults into objects, then does in memory ordering with EOSortOrdering.EOSortOrdering.sortedArrayUsingKeyOrderArray()
| ec | ||
| possibleFaults | ||
| sortOrderings |
| static NSArray objectsForGlobalIDs | ( | final EOEditingContext | ec, | |
| final NSArray | globalIDs | |||
| ) | [static] |
Aggregate method for EOEditingContext.objectForGlobalID(). NOTE: this only returns objects that are already registered, if you need all objects from the GIDs, use faultsForGlobalIDs(EOEditingContext, NSArray).
| static <TextendsEOEnterpriseObject> NSArray<T> objectsInRange | ( | EOEditingContext | ec, | |
| EOFetchSpecification | spec, | |||
| int | start, | |||
| int | end, | |||
| boolean | rawRowsForCustomQueries | |||
| ) | [static] |
Returns an NSArray containing the objects from the resulting rows starting at start and stopping at end using a custom SQL, derived from the SQL which the EOFetchSpecification would use normally setHints()
| ec | editingcontext to fetch objects into | |
| spec | fetch specification for the fetch | |
| start | ||
| end | ||
| rawRowsForCustomQueries | if true, raw rows will be returned from the fetch when there is a custom query |
| static <TextendsEOEnterpriseObject> NSArray<T> objectsInRange | ( | EOEditingContext | ec, | |
| EOFetchSpecification | spec, | |||
| int | start, | |||
| int | end | |||
| ) | [static] |
Returns an NSArray containing the objects from the resulting rows starting at start and stopping at end using a custom SQL, derived from the SQL which the EOFetchSpecification would use normally setHints()
| ec | editingcontext to fetch objects into | |
| spec | fetch specification for the fetch | |
| start | ||
| end |
| static NSArray objectsWithQualifier | ( | EOEditingContext | editingContext, | |
| String | entityName, | |||
| EOQualifier | qualifier, | |||
| NSArray | prefetchKeyPaths, | |||
| NSArray | sortOrderings, | |||
| int | fetchLimit, | |||
| boolean | usesDistinct, | |||
| boolean | isDeep, | |||
| NSDictionary | hints, | |||
| boolean | includeNewObjects, | |||
| boolean | includeNewObjectsInParentEditingContext, | |||
| boolean | filterUpdatedObjects, | |||
| boolean | removeDeletedObjects | |||
| ) | [static] |
Utility method used to fetch an array of objects given a qualifier. Also has support for filtering the newly inserted, updated, and deleted objects in the passed editing context or any parent editing contexts as well as specifying prefetching key paths. Note that only NEW objects are supported in parent editing contexts.
| editingContext | editing context to fetch it into | |
| entityName | name of the entity | |
| qualifier | qualifier | |
| prefetchKeyPaths | prefetching key paths | |
| sortOrderings | the sort orderings to use on the results | |
| fetchLimit | the fetch limit to use | |
| usesDistinct | whether or not to distinct the results | |
| isDeep | whether or not to fetch deeply | |
| hints | fetch hints to apply | |
| includeNewObjects | option to include newly inserted objects in the result set | |
| includeNewObjectsInParentEditingContext | option to include newly inserted objects in parent editing contexts. if true, the editing context lineage is explored, any newly-inserted objects matching the qualifier are collected and faulted down through all parent editing contexts of ec. | |
| filterUpdatedObjects | option to include updated objects that now match the qualifier or remove updated objects thats no longer match the qualifier | |
| removeDeletedObjects | option to remove objects that have been deleted |
| static NSArray objectsWithQualifier | ( | EOEditingContext | editingContext, | |
| String | entityName, | |||
| EOQualifier | qualifier, | |||
| NSArray | prefetchKeyPaths, | |||
| NSArray | sortOrderings, | |||
| boolean | usesDistinct, | |||
| boolean | isDeep, | |||
| NSDictionary | hints, | |||
| boolean | includeNewObjects, | |||
| boolean | includeNewObjectsInParentEditingContext, | |||
| boolean | filterUpdatedObjects, | |||
| boolean | removeDeletedObjects | |||
| ) | [static] |
Utility method used to fetch an array of objects given a qualifier. Also has support for filtering the newly inserted, updateed, and deleted objects in the passed editing context or any parent editing contexts as well as specifying prefetching key paths. Note that only NEW objects are supported in parent editing contexts.
| editingContext | editing context to fetch it into | |
| entityName | name of the entity | |
| qualifier | qualifier | |
| prefetchKeyPaths | prefetching key paths | |
| sortOrderings | the sort orderings to use on the results | |
| usesDistinct | whether or not to distinct the results | |
| isDeep | whether or not to fetch deeply | |
| hints | fetch hints to apply | |
| includeNewObjects | option to include newly inserted objects in the result set | |
| includeNewObjectsInParentEditingContext | option to include newly inserted objects in parent editing contexts. if true, the editing context lineage is explored, any newly-inserted objects matching the qualifier are collected and faulted down through all parent editing contexts of ec. | |
| filterUpdatedObjects | option to include updated objects that now match the qualifier or remove updated objects thats no longer match the qualifier | |
| removeDeletedObjects | option to remove objects that have been deleted |
| static NSArray objectsWithQualifier | ( | EOEditingContext | editingContext, | |
| String | entityName, | |||
| EOQualifier | qualifier, | |||
| NSArray | prefetchKeyPaths, | |||
| boolean | includeNewObjects, | |||
| boolean | includeNewObjectsInParentEditingContext, | |||
| boolean | filterUpdatedObjects, | |||
| boolean | removeDeletedObjects | |||
| ) | [static] |
Utility method used to fetch an array of objects given a qualifier. Also has support for filtering the newly inserted, updated, and deleted objects in the passed editing context or any parent editing contexts as well as specifying prefetching key paths. Note that only NEW objects are supported in parent editing contexts.
| editingContext | editing context to fetch it into | |
| entityName | name of the entity | |
| qualifier | qualifier | |
| prefetchKeyPaths | prefetching key paths | |
| includeNewObjects | option to include newly inserted objects in the result set | |
| includeNewObjectsInParentEditingContext | option to include newly inserted objects in parent editing contexts. if true, the editing context lineage is explored, any newly-inserted objects matching the qualifier are collected and faulted down through all parent editing contexts of ec. | |
| filterUpdatedObjects | option to include updated objects that now match the qualifier or remove updated objects thats no longer match the qualifier | |
| removeDeletedObjects | option to remove objects that have been deleted |
| static NSArray objectsWithQualifier | ( | EOEditingContext | _editingContext, | |
| String | _entityName, | |||
| EOQualifier | _qualifier, | |||
| NSArray | _prefetchKeyPaths, | |||
| boolean | _includeNewObjects, | |||
| boolean | _includeNewObjectsInParentEditingContext | |||
| ) | [static] |
| static NSArray objectsWithQualifier | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| EOQualifier | qualifier, | |||
| NSArray | prefetchKeyPaths, | |||
| boolean | includeNewObjects | |||
| ) | [static] |
Calls objectsWithQualifier(ec, entityName, qualifier, prefetchKeyPaths, includeNewObjects, false).
That is, passes false for includeNewObjectsInParentEditingContexts. This method exists to maintain API compatability.
| static NSArray objectsWithQualifierFormat | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| String | qualifierFormat, | |||
| NSArray | args, | |||
| NSArray | prefetchKeyPaths, | |||
| boolean | includeNewObjects, | |||
| boolean | includeNewObjectsInParentEditingContexts | |||
| ) | [static] |
Enhanced version of the utility method found in EOUtilities. Adds support for including newly created objects in the fetch as well as prefetching key paths.
| ec | editing context to fetch it into | |
| entityName | name of the entity | |
| qualifierFormat | format of the qualifier string | |
| args | qualifier arguments | |
| prefetchKeyPaths | prefetching key paths | |
| includeNewObjects | option to include newly inserted objects in the result set | |
| includeNewObjectsInParentEditingContexts | option to include newly inserted objects in parent editing contexts |
| static NSArray objectsWithQualifierFormat | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| String | qualifierFormat, | |||
| NSArray | args, | |||
| NSArray | prefetchKeyPaths, | |||
| boolean | includeNewObjects | |||
| ) | [static] |
Calls objectsWithQualifierFormat(ec, entityName, qualifierFormat, args, prefetchKeyPaths, includeNewObjects, false)
That is, passes false for includeNewObjectsInParentEditingContexts. This method exists to maintain API compatability.
| static EOEnterpriseObject objectWithPrimaryKeyValue | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| Object | primaryKeyValue, | |||
| NSArray | prefetchingKeyPaths, | |||
| boolean | refreshRefetchedObjects | |||
| ) | [static] |
Fetches an enterprise object based on a given primary key value. This method has an advantage over the standard EOUtilities method in that you can specify prefetching key paths as well as refreshing the snapshot of the given object
| ec | editing context to fetch into | |
| entityName | name of the entity | |
| primaryKeyValue | primary key value. Compound primary keys are given as NSDictionaries. | |
| prefetchingKeyPaths | key paths to fetch off of the eo | |
| refreshRefetchedObjects | if true, the object will be refetched and refreshed |
| IllegalStateException | if the entity has a compound key and only one key is provided or if more than one object is found matching the value. |
| static EOEnterpriseObject objectWithPrimaryKeyValue | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| Object | primaryKeyValue, | |||
| NSArray | prefetchingKeyPaths | |||
| ) | [static] |
Fetches an enterprise object based on a given primary key value. This method has an advantage over the standard EOUtilities method in that you can specify prefetching key paths as well as refreshing the snapshot of the given object
| ec | editing context to fetch into | |
| entityName | name of the entity | |
| primaryKeyValue | primary key value. Compound primary keys are given as NSDictionaries. | |
| prefetchingKeyPaths | key paths to fetch off of the eo |
| static EOEnterpriseObject objectWithQualifier | ( | EOEditingContext | editingContext, | |
| String | entityName, | |||
| EOQualifier | qualifier | |||
| ) | [static] |
Returns the single object of the given type matching the qualifier.
| editingContext | the editing context to look in | |
| entityName | the name of the entity to look for | |
| qualifier | the qualifier to restrict by |
| MoreThanOneException | if more than one object matches the qualifier |
| static EOQualifier orQualifier | ( | EOQualifier | q1, | |
| EOQualifier | q2 | |||
| ) | [static] |
Joins the given qualifiers with an OR. One or both arguments may be null, if both are null, null is returned.
| q1 | ||
| q2 |
| static EOQualifier orQualifierForKeyPaths | ( | NSArray | keyPaths, | |
| NSSelector | selector, | |||
| NSArray | values | |||
| ) | [static] |
Creates an OR qualifier with the given selector for all the given key paths and all the given serach terms. If you want LIKE matches, you need to the add "*" yourself.
| keyPaths | ||
| selector | ||
| values |
| static EOQualifier orQualifierForKeyPaths | ( | NSArray | keyPaths, | |
| NSSelector | selector, | |||
| Object | value | |||
| ) | [static] |
Creates an OR qualifier with the given selector for all the given key paths. If you want LIKE matches, you need to the add "*" yourself.
| keyPaths | ||
| selector | ||
| value |
| static NSArray primaryKeyArrayForObject | ( | EOEnterpriseObject | obj | ) | [static] |
Gives the primary key array for a given enterprise object. This has the advantage of not firing the fault of the object, unlike the method in EOUtilities.
| obj | enterprise object to get the primary key array from. |
| static NSDictionary<String, Object> primaryKeyDictionaryForString | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| String | string | |||
| ) | [static] |
Returns the decoded dictionary for an propertylist encoded string representation of the primary key for a given object.
| static EOFetchSpecification primaryKeyFetchSpecificationForEntity | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| EOQualifier | eoqualifier, | |||
| NSArray< EOSortOrdering > | sortOrderings, | |||
| NSArray< String > | additionalKeys | |||
| ) | [static] |
Constructs a fetch specification that will only fetch the primary keys for a given qualifier.
| ec | editing context, only used to determine the entity | |
| entityName | name of the entity, only used to determine the entity | |
| eoqualifier | to construct the fetch spec with | |
| sortOrderings | array of sort orderings to sort the result set with. | |
| additionalKeys | array of additional key paths to construct the raw rows key paths to fetch. |
| static Object primaryKeyObjectForObject | ( | EOEnterpriseObject | eo | ) | [static] |
| static NSArray primaryKeysMatchingQualifier | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| EOQualifier | eoqualifier, | |||
| NSArray< EOSortOrdering > | sortOrderings | |||
| ) | [static] |
Fetches an array of primary keys matching a given qualifier and sorted with a given array of sort orderings.
| ec | editing context to fetch into | |
| entityName | name of the entity | |
| eoqualifier | to restrict matching primary keys | |
| sortOrderings | array of sort orders to sort result set |
| static String primaryKeyStringForGlobalID | ( | EOKeyGlobalID | gid | ) | [static] |
Returns the propertylist-encoded string representation of the global ID.
| gid | the global id of the oject to get the primary key for. |
| static String primaryKeyStringForObject | ( | EOEnterpriseObject | eo | ) | [static] |
Returns the propertylist-encoded string representation of the primary key for a given object.
| eo | object to get the primary key for. |
| static NSArray primaryKeyValuesInRange | ( | EOEditingContext | ec, | |
| EOFetchSpecification | spec, | |||
| int | start, | |||
| int | end | |||
| ) | [static] |
Returns an NSArray containing the primary keys from the resulting rows starting at start and stopping at end using a custom SQL, derived from the SQL which the EOFetchSpecification would use normally setHints()
| ec | editingcontext to fetch objects into | |
| spec | fetch specification for the fetch | |
| start | ||
| end |
| static EOQualifier qualifierMatchingAnyKey | ( | NSArray | keys, | |
| NSSelector | selector, | |||
| Object | value | |||
| ) | [static] |
Creates an OR qualifier of EOKeyValueQualifiers for every keypath in the given array of keys. This is useful when trying to find a string in a set of attributes.
| keys | ||
| selector | ||
| value |
| static void refaultObject | ( | EOEnterpriseObject | eo | ) | [static] |
Turns a given enterprise object back into a fault.
| eo | enterprise object to refault |
| static NSDictionary<String, Integer> registeredObjectCount | ( | EOEditingContext | ec | ) | [static] |
Returns the count of registered objects in the EC grouped by entity name, which is useful for memory debugging. Put this in a log on session.sleep() for example.
| ec | editing context to get count of |
| static EOEnterpriseObject requiredObjectWithQualifier | ( | EOEditingContext | editingContext, | |
| String | entityName, | |||
| EOQualifier | qualifier | |||
| ) | [static] |
Returns the single object of the given type matching the qualifier.
| editingContext | the editing context to look in | |
| entityName | the name of the entity to look for | |
| qualifier | the qualifier to restrict by |
| EOObjectNotAvailableException | if no objects match the qualifier | |
| MoreThanOneException | if more than one object matches the qualifier |
| static EOEntity rootEntity | ( | EOEnterpriseObject | eo | ) | [static] |
Returns the root entity from the EOEnterpriseObject
| eo | the EOEnterpriseObject from which to the the root entity |
| static String rootEntityName | ( | EOEnterpriseObject | eo | ) | [static] |
Returns the name from the root entity from the EOEnterpriseObject
| eo | the EOEnterpriseObject from which to the the root entity |
| static EOFetchSpecification schemaBasedFetchSpecification | ( | EOEditingContext | ec, | |
| EOFetchSpecification | fetchSpecification | |||
| ) | [static] |
Useful for ensuring a fetch specification is safe to pass around between threads and not having to be concerned about references to EOs in the qualifier.
| ec | a locked EOEditingContext that can be used for getting the entity | |
| fetchSpecification |
| static EOQualifier schemaBasedQualifier | ( | EOEditingContext | ec, | |
| String | entityName, | |||
| EOQualifier | qualifier | |||
| ) | [static] |
Useful for ensuring a qualifier is safe to pass around between threads and not having to be concerned about references to EOs in it. Also handy to verify that an EOQualifier can be used in a database fetch.
| ec | a locked EOEditingContext that can be used for getting the entity | |
| entityName | the entity being qualified | |
| qualifier | original qualifier |
| static EOEnterpriseObject sharedObjectMatchingKeyAndValue | ( | String | entityName, | |
| String | key, | |||
| Object | value | |||
| ) | [static] |
Finds an object in the shared editing context matching a key and value. This has the benifit of not requiring a database round trip if the entity is shared.
| entityName | name of the shared entity | |
| key | to match against | |
| value | value to match |
| static NSArray sharedObjectsForEntityNamed | ( | String | entityName | ) | [static] |
Gets all of the shared objects for a given entity name. Note that if the shared objects for the corresponding model have not been loaded yet, this method will trigger their loading (unless automatic loading has been disabled via a call to com.webobjects.eoaccess.EODatabaseContext#setSharedObjectLoadingEnabled(boolean)). Returns an empty array if no shared objects were found.
| entityName | name of the shared entity |
| static NSArray sharedObjectsMatchingKeyAndValue | ( | String | entityName, | |
| String | key, | |||
| Object | value | |||
| ) | [static] |
Finds objects in the shared editing context matching a key and value. This has the benifit of not requiring a database round trip if the entity is shared.
| entityName | name of the shared entity | |
| key | to match against | |
| value | value to match |
| static NSArray sharedObjectsWithFetchSpecificationNamed | ( | String | entityName, | |
| String | fetchSpecName | |||
| ) | [static] |
| static EOEnterpriseObject sharedObjectWithFetchSpec | ( | String | entityName, | |
| String | fetchSpec | |||
| ) | [static] |
Fetches a shared enterprise object for a given fetch specification from the default shared editing context.
| fetchSpec | name of the fetch specification on the shared object. | |
| entityName | name of the shared entity |
| static EOEnterpriseObject sharedObjectWithPrimaryKey | ( | String | entityName, | |
| Object | primaryKey | |||
| ) | [static] |
Gets the shared enterprise object with the given primary from the default shared editing context. This has the advantage of not requiring a roundtrip to the database to lookup the object. But, it will fetch if the object is not found in the default shared editing context.
| entityName | name of the entity | |
| primaryKey | primary key of object to be found |
| static synchronized NSArray stringAttributeListForEntityNamed | ( | EOEditingContext | ec, | |
| String | entityName | |||
| ) | [static] |
Calculates all of the EOAttributes of a given entity that are mapped to String objects.
| static void trimSpaces | ( | EOEnterpriseObject | object | ) | [static] |
Trims all values from string attributes from the given EO.
| object |
| static NSMutableArray updatedObjects | ( | EOEditingContext | editingContext, | |
| NSArray< String > | entityNames, | |||
| EOQualifier | qualifier | |||
| ) | [static] |
| editingContext | the editing context to look in | |
| entityNames | the names of the entity to look for | |
| qualifier | the qualifier to restrict by |
| static void validateUniquenessOf | ( | String | entityName, | |
| EOEnterpriseObject | eo, | |||
| String... | keys | |||
| ) | [static] |
Convinience method which passes null for restrictingQualifier.
| eo | the EOEnterpriseObject to validate | |
| keys | an arbitrary number of keyPaths to validate. | |
| entityName | the name of the entity to check. Defaults to eo.entityName(). It can be necessary to set this to the name of the parent entity when using single table inheritance. |
| static void validateUniquenessOf | ( | EOEnterpriseObject | eo, | |
| String... | keys | |||
| ) | [static] |
Convinience method which passes null for restrictingQualifier and entityName.
| eo | the EOEnterpriseObject to validate | |
| keys | an arbitrary number of keyPaths to validate. |
| static void validateUniquenessOf | ( | EOEnterpriseObject | eo, | |
| EOQualifier | restrictingQualifier, | |||
| String... | keys | |||
| ) | [static] |
Convinience method which passes null for entityName.
| eo | the EOEnterpriseObject to validate | |
| restrictingQualifier | an optional resticting qualifier to exclude certain objects from the check | |
| keys | an arbitrary number of keyPaths to validate. |
| static void validateUniquenessOf | ( | String | entityName, | |
| EOEnterpriseObject | eo, | |||
| EOQualifier | restrictingQualifier, | |||
| String... | keys | |||
| ) | [static] |
Validates whether the values of the specified keyPaths are unique for an Entity. Throws a ERXValidationException if there is already an EO with the same values on the given key paths.
Should be combined with a constraint on the corresponding database columns.
Based on Zak Burke's idea he posted to WOCode a while ago.
Use in validateForSave like this:
...
public class WikiPage extends _WikiPage {
...
public void validateForSave() throws ValidationException {
super.validateForSave();
ERXEOControlUtilities.validateUniquenessOf(null, this, ERXQ.equals("active", true), "title", "wiki");
}
...
}
Combine with entries in ValidationTemplate.strings like:
"WikiPage.title,space.UniquenessViolationNewObject" = "The page cannot be created. There is already a page named <b>@value.title@</b> in Wiki <b>@value.wiki.name@</b>."; "WikiPage.title,space.UniquenessViolationExistingObject" = "The page cannot be changed this way. There is already a page named <b>@value.title@</b> in Wiki <b>@value.wiki.name@</b>.";
| eo | the EOEnterpriseObject to validate | |
| keys | an arbitrary number of keyPaths to validate. | |
| restrictingQualifier | an optional resticting qualifier to exclude certain objects from the check | |
| entityName | the name of the entity to check. Defaults to eo.entityName(). It can be necessary to set this to the name of the parent entity when using single table inheritance. |
| ERXValidationException | if an EO with the same property values already exists. If you specify more than one keyPath to validate, the 'key' property will be a comma separated string of the provided keyPaths. 'value' will be a dictionary with the supplied keyPaths as keys and the values corresponding to these keys in the supplied eo as values. |
NSMutableDictionary _attributeKeysPerEntityName = new NSMutableDictionary() [static, private] |
Caches the string attribute keys on a per entity name basis
1.5.8