Project Wonder 2.0

er.extensions
Class ERXEOControlUtilities

java.lang.Object
  extended byer.extensions.ERXEOControlUtilities

public class ERXEOControlUtilities
extends Object

Collection of EOF utility method centered around EOControl.


Field Summary
static ERXLogger log
          logging support
 
Constructor Summary
ERXEOControlUtilities()
           
 
Method Summary
static String _stringForPrimaryKey(Object pk)
          Returns the propertylist-encoded string representation of the primary key for a given object.
static void addObjectToObjectOnBothSidesOfRelationshipWithKey(EOEnterpriseObject addedObject, EOEnterpriseObject referenceObject, String key)
          Adds an object to another objects relationship.
static Number aggregateFunctionWithQualifier(EOEditingContext ec, String entityName, String attributeName, String function, EOQualifier qualifier)
          Computes an aggregate function for a given attribute restricted by a given qualifier.
static Number aggregateFunctionWithQualifier(EOEditingContext ec, String entityName, String attributeName, String function, String fetchSpecificationName, NSDictionary bindings)
          Computes an aggregate function for a given attribute restricted by a given qualifier.
static NSArray arrayFromDataSource(EODataSource dataSource)
          Converts a datasource into an array.
static void clearSnapshotForRelationshipNamed(EOEnterpriseObject eo, String relationshipName)
          Clears snapshot the relaationship of a given enterprise so it will be read again when next accessed.
static EOEnterpriseObject createAndAddObjectToRelationship(EOEditingContext editingContext, EOEnterpriseObject source, String relationshipName, String destinationEntityName, NSDictionary objectInfo)
          Creates an object using the utility method createEO from this utility class.
static EOEnterpriseObject createAndInsertObject(EOEditingContext editingContext, String entityName)
          Creates an enterprise object for the given entity name by first looking up the class description of the entity to create the enterprise object.
static EOEnterpriseObject createAndInsertObject(EOEditingContext editingContext, String entityName, NSDictionary objectInfo)
          Creates an enterprise object for the given entity name by first looking up the class description of the entity to create the enterprise object.
static EOArrayDataSource dataSourceForArray(NSArray array)
          Simple utility method that will convert an array of enterprise objects into an EOArrayDataSource.
static EODetailDataSource dataSourceForObjectAndKey(EOEnterpriseObject object, String key)
          Creates a detail data source for a given enterprise object and a relationship key.
static EOEnterpriseObject editableInstanceOfObject(EOEnterpriseObject eo, boolean createNestedContext)
          Creates a new, editable instance of the supplied object.
static NSArray faultsForGlobalIDsInEditingContext(NSArray gids, EOEditingContext ec)
          returns a NSArray containing EOEnterpriseObjects (actually faults...) for the provided EOGlobalIDs.
static EOFetchSpecification fetchSpecificationNamedWithBindings(String entityName, String fetchSpecificationName, NSDictionary bindings)
          Gets a fetch specification from a given entity.
static NSArray globalIDsForObjects(NSArray eos)
          returns a NSArray containing EOGlobalIDs from the provided eos.
static boolean isNewObject(EOEnterpriseObject eo)
          Tests if an enterprise object is a new object by looking to see if it is in the list of inserted objects for the editing context or if the editing context is null.
static EOEnterpriseObject localInstanceOfObject(EOEditingContext ec, EOEnterpriseObject eo)
          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.
static EOQualifier localInstancesInQualifier(EOEditingContext ec, EOQualifier q)
          faults every EO in the qualifiers into the specified editingContext.
static NSArray localInstancesOfObjects(EOEditingContext ec, NSArray eos)
          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.
static NSDictionary newPrimaryKeyDictionaryForEntityNamed(EOEditingContext ec, String entityName)
          Utility method to generate a new primary key dictionary using the adaptor for a given entity.
static NSDictionary newPrimaryKeyDictionaryForObject(EOEnterpriseObject eo)
          Utility method to generate a new primary key for an object.
static NSDictionary newPrimaryKeyDictionaryForObjectFromClassProperties(EOEnterpriseObject eo)
          Utility method to generate a new primary key dictionary using the objects class properties.
static Number objectCountUniqueWithQualifierAndAttribute(EOEditingContext ec, String entityName, EOQualifier qualifier, String attributeName)
          Returns the number of unique objects matching the given qualifier for a given entity name.
static Number objectCountWithQualifier(EOEditingContext ec, String entityName, EOQualifier qualifier)
          Returns the number of objects matching the given qualifier for a given entity name.
static NSArray objectsInRange(EOEditingContext ec, EOFetchSpecification spec, int start, int end)
          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()
static NSArray objectsWithQualifier(EOEditingContext ec, String entityName, EOQualifier qualifier, NSArray prefetchKeyPaths, boolean includeNewObjects)
          Utility method used to fetch an array of objects given a qualifier.
static NSArray objectsWithQualifierFormat(EOEditingContext ec, String entityName, String qualifierFormat, NSArray args, NSArray prefetchKeyPaths, boolean includeNewObjects)
          Enhanced version of the utility method found in EOUtilities.
static EOEnterpriseObject objectWithPrimaryKeyValue(EOEditingContext ec, String entityName, Object primaryKeyValue, NSArray prefetchingKeyPaths)
          Fetches an enterprise object based on a given primary key value.
static NSArray primaryKeyArrayForObject(EOEnterpriseObject obj)
          Gives the primary key array for a given enterprise object.
static NSDictionary primaryKeyDictionaryForString(EOEditingContext ec, String entityName, String string)
          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 sortOrderings, NSArray additionalKeys)
          Constructs a fetch specification that will only fetch the primary keys for a given qualifier.
static Object primaryKeyObjectForObject(EOEnterpriseObject eo)
          Returns either the single object the PK consist of or the NSArray of its values if the key is compound.
static NSArray primaryKeysMatchingQualifier(EOEditingContext ec, String entityName, EOQualifier eoqualifier, NSArray sortOrderings)
          Fetches an array of primary keys matching a given qualifier and sorted with a given array of sort orderings.
static String primaryKeyStringForObject(EOEnterpriseObject eo)
          Returns the propertylist-encoded string representation of the primary key for a given object.
static EOQualifier qualifierMatchingAnyKey(NSArray keys, NSSelector selector, Object value)
          Creates an OR qualifier of EOKeyValueQualifiers for every keypath in the given array of keys.
static void refaultObject(EOEnterpriseObject eo)
          Turns a given enterprise object back into a fault.
static EOEnterpriseObject sharedObjectMatchingKeyAndValue(String entityName, String key, Object value)
          Finds an object in the shared editing context matching a key and value.
static NSArray sharedObjectsForEntityNamed(String entityName)
          Gets all of the shared objects for a given entity name.
static NSArray sharedObjectsMatchingKeyAndValue(String entityName, String key, Object value)
          Finds objects in the shared editing context matching a key and value.
static EOEnterpriseObject sharedObjectWithFetchSpec(String entityName, String fetchSpec)
          Fetches a shared enterprise object for a given fetch specification from the default shared editing context.
static EOEnterpriseObject sharedObjectWithPrimaryKey(String entityName, Object primaryKey)
          Gets the shared enterprise object with the given primary from the default shared editing context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static final ERXLogger log
logging support

Constructor Detail

ERXEOControlUtilities

public ERXEOControlUtilities()
Method Detail

localInstancesOfObjects

public static NSArray localInstancesOfObjects(EOEditingContext ec,
                                              NSArray eos)
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.

Parameters:
ec - editing context to pull local object copies
eos - array of enterprise objects
Returns:
an array of copies of local objects

dataSourceForArray

public static EOArrayDataSource dataSourceForArray(NSArray array)
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.

Parameters:
array - collection of objects to be turned into a datasource
Returns:
an array datasource corresponding to the array of objects passed in.

arrayFromDataSource

public static NSArray arrayFromDataSource(EODataSource dataSource)
Converts a datasource into an array.

Parameters:
dataSource - data source to be converted
Returns:
array of objects that the data source represents

dataSourceForObjectAndKey

public static EODetailDataSource dataSourceForObjectAndKey(EOEnterpriseObject object,
                                                           String key)
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.

Parameters:
object - that has the relationship
key - relationship key
Returns:
detail data source for the given object-key pair.

editableInstanceOfObject

public static EOEnterpriseObject editableInstanceOfObject(EOEnterpriseObject eo,
                                                          boolean createNestedContext)
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.

Parameters:
eo - object for the new instance
createNestedContext - true, if we should create a nested context (otherwise we create a peer context)
Returns:
new EO in new editing context

localInstanceOfObject

public static EOEnterpriseObject localInstanceOfObject(EOEditingContext ec,
                                                       EOEnterpriseObject eo)
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.

Parameters:
ec - editing context to get a local instance of the object in
eo - object to get a local copy of
Returns:
enterprise object local to the passed in editing contex

createAndInsertObject

public static EOEnterpriseObject createAndInsertObject(EOEditingContext editingContext,
                                                       String entityName)
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.

Parameters:
editingContext - editingContext to insert the created object into
entityName - name of the entity to be created.
Returns:
created and inserted enterprise object

createAndInsertObject

public static EOEnterpriseObject createAndInsertObject(EOEditingContext editingContext,
                                                       String entityName,
                                                       NSDictionary objectInfo)
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.

Parameters:
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.
Returns:
created and inserted enterprise object

createAndAddObjectToRelationship

public static EOEnterpriseObject createAndAddObjectToRelationship(EOEditingContext editingContext,
                                                                  EOEnterpriseObject source,
                                                                  String relationshipName,
                                                                  String destinationEntityName,
                                                                  NSDictionary objectInfo)
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.

Parameters:
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.
Returns:
the newly created enterprise object

addObjectToObjectOnBothSidesOfRelationshipWithKey

public static void addObjectToObjectOnBothSidesOfRelationshipWithKey(EOEnterpriseObject addedObject,
                                                                     EOEnterpriseObject referenceObject,
                                                                     String key)
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.

Parameters:
addedObject - object to be added to the relationship
referenceObject - object that has the relationship
key - relationship key

refaultObject

public static void refaultObject(EOEnterpriseObject eo)
Turns a given enterprise object back into a fault.

Parameters:
eo - enterprise object to refault

clearSnapshotForRelationshipNamed

public static void clearSnapshotForRelationshipNamed(EOEnterpriseObject eo,
                                                     String relationshipName)
Clears snapshot the relaationship of a given enterprise so it will be read again when next accessed.

Parameters:
eo - enterprise object
relationshipName - relationship name

primaryKeyFetchSpecificationForEntity

public static EOFetchSpecification primaryKeyFetchSpecificationForEntity(EOEditingContext ec,
                                                                         String entityName,
                                                                         EOQualifier eoqualifier,
                                                                         NSArray sortOrderings,
                                                                         NSArray additionalKeys)
Constructs a fetch specification that will only fetch the primary keys for a given qualifier.

Parameters:
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.
Returns:
fetch specification that can be used to fetch primary keys for a given qualifier and sort orderings.

primaryKeysMatchingQualifier

public static NSArray primaryKeysMatchingQualifier(EOEditingContext ec,
                                                   String entityName,
                                                   EOQualifier eoqualifier,
                                                   NSArray sortOrderings)
Fetches an array of primary keys matching a given qualifier and sorted with a given array of sort orderings.

Parameters:
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
Returns:
array of primary keys matching a given qualifier

objectWithPrimaryKeyValue

public static EOEnterpriseObject objectWithPrimaryKeyValue(EOEditingContext ec,
                                                           String entityName,
                                                           Object primaryKeyValue,
                                                           NSArray prefetchingKeyPaths)
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

Parameters:
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
Returns:
enterprise object matching the given value

objectsInRange

public static NSArray objectsInRange(EOEditingContext ec,
                                     EOFetchSpecification spec,
                                     int start,
                                     int end)
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()

Parameters:
ec - editingcontext to fetch objects into
spec - fetch specification for the fetch
start -
end -
Returns:
objects in the given range

objectCountWithQualifier

public static Number objectCountWithQualifier(EOEditingContext ec,
                                              String entityName,
                                              EOQualifier qualifier)
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.

Parameters:
ec - editing context to use for the count qualification
entityName - name of the entity to fetch
qualifier - to find the matching objects
Returns:
number of matching objects

objectCountUniqueWithQualifierAndAttribute

public static Number objectCountUniqueWithQualifierAndAttribute(EOEditingContext ec,
                                                                String entityName,
                                                                EOQualifier qualifier,
                                                                String attributeName)
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.

Parameters:
ec - editing context to use for the count qualification
entityName - name of the entity to fetch
qualifier - to find the matching objects
Returns:
number of matching objects

aggregateFunctionWithQualifier

public static Number aggregateFunctionWithQualifier(EOEditingContext ec,
                                                    String entityName,
                                                    String attributeName,
                                                    String function,
                                                    String fetchSpecificationName,
                                                    NSDictionary bindings)
Computes an aggregate function for a given attribute restricted by a given qualifier. For instance select MAX(AGE) from User where name like 'M*'

Parameters:
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.
Returns:
aggregate result of the fuction call

aggregateFunctionWithQualifier

public static Number aggregateFunctionWithQualifier(EOEditingContext ec,
                                                    String entityName,
                                                    String attributeName,
                                                    String function,
                                                    EOQualifier qualifier)
Computes an aggregate function for a given attribute restricted by a given qualifier. For instance select MAX(AGE) from User where name like 'M*'

Parameters:
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
Returns:
aggregate result of the fuction call

sharedObjectMatchingKeyAndValue

public static EOEnterpriseObject sharedObjectMatchingKeyAndValue(String entityName,
                                                                 String key,
                                                                 Object value)
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.

Parameters:
entityName - name of the shared entity
key - to match against
value - value to match
Returns:
matching shared object

sharedObjectsMatchingKeyAndValue

public static NSArray sharedObjectsMatchingKeyAndValue(String entityName,
                                                       String key,
                                                       Object value)
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.

Parameters:
entityName - name of the shared entity
key - to match against
value - value to match
Returns:
array of shared objects matching key and value

sharedObjectsForEntityNamed

public static NSArray sharedObjectsForEntityNamed(String entityName)
Gets all of the shared objects for a given entity name. Note that if the entity has not been loaded yet, ie it's model has not been accessed then this method will return an empty array.

Parameters:
entityName - name of the shared entity
Returns:
array of bound shared objects for the given entity name

sharedObjectWithFetchSpec

public static EOEnterpriseObject sharedObjectWithFetchSpec(String entityName,
                                                           String fetchSpec)
Fetches a shared enterprise object for a given fetch specification from the default shared editing context.

Parameters:
fetchSpec - name of the fetch specification on the shared object.
entityName - name of the shared entity
Returns:
the shared enterprise object fetch by the fetch spec named.

sharedObjectWithPrimaryKey

public static EOEnterpriseObject sharedObjectWithPrimaryKey(String entityName,
                                                            Object primaryKey)
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.

Parameters:
entityName - name of the entity
Returns:
the shared object registered in the default shared editing context

fetchSpecificationNamedWithBindings

public static EOFetchSpecification fetchSpecificationNamedWithBindings(String entityName,
                                                                       String fetchSpecificationName,
                                                                       NSDictionary bindings)
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.

Parameters:
entityName - name of the entity that the fetch specification is bound to
fetchSpecificationName - name of the fetch specification
Returns:
fetch specification identified by name and potentially with the qualifier bindings replaced.

newPrimaryKeyDictionaryForObjectFromClassProperties

public static NSDictionary newPrimaryKeyDictionaryForObjectFromClassProperties(EOEnterpriseObject eo)
Utility method to generate a new primary key dictionary using the objects class properties. Use it when your PKs are class properties.

Parameters:
eo - object in question
Returns:
new primary key dictionary or null if one of the properties is null or one of the primary key attributes is not a class property.

newPrimaryKeyDictionaryForObject

public static NSDictionary newPrimaryKeyDictionaryForObject(EOEnterpriseObject eo)
Utility method to generate a new primary key for an object. Calls #newPrimaryKeyForObjectFromClassProperties(EOEnterpriseObject) and if that returns null, newPrimaryKeyDictionaryForEntityNamed(EOEditingContext, String)

Returns:
new primary key dictionary or null if a failure occured.

newPrimaryKeyDictionaryForEntityNamed

public static NSDictionary newPrimaryKeyDictionaryForEntityNamed(EOEditingContext ec,
                                                                 String entityName)
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.

Parameters:
ec - editing context
entityName - name of the entity to generate the primary key dictionary for.
Returns:
a dictionary containing a new primary key for the given entity.

primaryKeyStringForObject

public static String primaryKeyStringForObject(EOEnterpriseObject eo)
Returns the propertylist-encoded string representation of the primary key for a given object.

Parameters:
eo - object to get the primary key for.
Returns:
string representation of the primary key of the object.

_stringForPrimaryKey

public static String _stringForPrimaryKey(Object pk)
Returns the propertylist-encoded string representation of the primary key for a given object. Made public only for ERXGenericRecord.

Parameters:
pk - the primary key
Returns:
string representation of the primary key.

primaryKeyDictionaryForString

public static NSDictionary primaryKeyDictionaryForString(EOEditingContext ec,
                                                         String entityName,
                                                         String string)
Returns the decoded dictionary for an propertylist encoded string representation of the primary key for a given object.

Returns:
string representation of the primary key of the object.

primaryKeyObjectForObject

public static Object primaryKeyObjectForObject(EOEnterpriseObject eo)
Returns either the single object the PK consist of or the NSArray of its values if the key is compound.

Parameters:
eo - object to get the primary key for.
Returns:
single object or NSArray

primaryKeyArrayForObject

public static NSArray primaryKeyArrayForObject(EOEnterpriseObject obj)
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.

Parameters:
obj - enterprise object to get the primary key array from.
Returns:
array of all the primary key values for the object.

objectsWithQualifierFormat

public static NSArray objectsWithQualifierFormat(EOEditingContext ec,
                                                 String entityName,
                                                 String qualifierFormat,
                                                 NSArray args,
                                                 NSArray prefetchKeyPaths,
                                                 boolean includeNewObjects)
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.

Parameters:
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
Returns:
array of objects matching the constructed qualifier

objectsWithQualifier

public static NSArray objectsWithQualifier(EOEditingContext ec,
                                           String entityName,
                                           EOQualifier qualifier,
                                           NSArray prefetchKeyPaths,
                                           boolean includeNewObjects)
Utility method used to fetch an array of objects given a qualifier. Also has support for filtering the newly inserted objects as well as specifying prefetching key paths.

Parameters:
ec - editing context to fetch it into
entityName - name of the entity
prefetchKeyPaths - prefetching key paths
includeNewObjects - option to include newly inserted objects in the result set
Returns:
array of objects matching the constructed qualifier

localInstancesInQualifier

public static EOQualifier localInstancesInQualifier(EOEditingContext ec,
                                                    EOQualifier q)
faults every EO in the qualifiers into the specified editingContext. This is important for in memory filtering and eo comparision

Parameters:
ec -
q -

globalIDsForObjects

public static NSArray globalIDsForObjects(NSArray eos)
returns a NSArray containing EOGlobalIDs from the provided eos.

Returns:
a NSArray of EOGlobalIDs

faultsForGlobalIDsInEditingContext

public static NSArray faultsForGlobalIDsInEditingContext(NSArray gids,
                                                         EOEditingContext ec)
returns a NSArray containing EOEnterpriseObjects (actually faults...) for the provided EOGlobalIDs.

Parameters:
gids - the EOGlobalIDs
ec - the EOEditingContext in which the EOEnterpriseObjects should be faulted
Returns:
a NSArray of EOEnterpriseObjects

isNewObject

public static boolean isNewObject(EOEnterpriseObject eo)
Tests if an enterprise object is a new object by looking to see if it is in the list of inserted objects for the editing context or if the editing context is null.

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.

Parameters:
eo - enterprise object to check
Returns:
true or false depending on if the object is a new object.

qualifierMatchingAnyKey

public static EOQualifier qualifierMatchingAnyKey(NSArray keys,
                                                  NSSelector selector,
                                                  Object value)
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.

Parameters:
keys -
selector -
value -
Returns:

Last updated: Do, Dez 9, 2004 • 12:46 PM CET

Copyright © 2002 – 2004 Project Wonder.