The Objective-C source
code for EOUtilities is available as an example. On Mac OS X Server systems,
see /System/Developer/Examples/EnterpriseObjects/Sources/EOUtilities.
On NT, see $NEXT_ROOT\Developer\Examples\EnterpriseObjects\Sources\EOUtilities. |
Method Types
- Creating new objects
- - createAndInsertInstanceOfEntityNamed:
- Fetching multiple objects
- - objectsForEntityNamed:
- - objectsForEntityNamed:qualifierFormat:
- - objectsMatchingValue:forKey:entityNamed:
- - objectsMatchingValues:entityNamed:
- - objectsOfClass:
- - objectsWithFetchSpecificationNamed:entityNamed:bindings:
- Fetching single objects
- - objectForEntityNamed:qualifierFormat:
- - objectMatchingValue:forKey:entityNamed:
- - objectMatchingValues:entityNamed:
- - objectWithFetchSpecificationNamed:entityNamed:bindings:
- - objectWithPrimaryKey:entityNamed:
- - objectWithPrimaryKeyValue:entityNamed:
- Fetching raw rows
- - executeStoredProcedureNamed:arguments:
- - objectFromRawRow:entityNamed:
- - rawRowsForEntityNamed:qualifierFormat:
- - rawRowsMatchingValue:forKey:entityNamed:
- - rawRowsMatchingValues:entityNamed:
- - rawRowsWithSQL:modelNamed:
- - rawRowsWithStoredProcedureNamed:arguments:
- Accessing the EOF stack
- - connectWithModelNamed:connectionDictionaryOverrides:
- - databaseContextForModelNamed:
- Accessing object data
- - destinationKeyForSourceObject:relationshipNamed:
- - localInstanceOfObject:
- - localInstancesOfObjects:
- - primaryKeyForObject:
- Accessing model information
- - entityForClass:
- - entityForObject:
- - entityNamed:
- - modelGroup
Instance Methods
- (void)connectWithModelNamed:(NSString
*)modelName
connectionDictionaryOverrides:(NSDictionary
*)overrides
Connects to the database using the connection
information in the specified model and the provided overrides dictionary.
This method facilitates per-session database logins in WebObjects
applications. Typically, you'd put a login name and password in
the overrides dictionary and otherwise use the values in the model's
connection dictionary. Raises an exception if the connection failed.
- (id)createAndInsertInstanceOfEntityNamed:(NSString
*)entityName
Creates a new enterprise object for the specified
entity, inserts it into the receiver, and returns the new object.
- (EODatabaseContext *)databaseContextForModelNamed:(NSString
*)modelName
Returns the database context used to service
the specified model.
- (NSDictionary *)destinationKeyForSourceObject:(id)object
relationshipNamed:(NSString *)relationshipName
Returns the foreign key for the rows at the
destination entity of the specified relationship. As an example,
given entities Department and Employee with a relationship called
"department" joining Department.ID
and Employee.deptID
,
invoking this method on a Department object with ID equal to 5 returns
a dictionary with a value of 5 for the deptID
key.See
Also: - primaryKeyForObject:
- (EOEntity *)entityForClass:(Class)classObject
Returns the entity associated with the specified
class. Raises an exception if the specified entity can't be found
or if more than one entity is associated with the class.See
Also: - entityForObject:, - entityNamed:, - objectsOfClass:
- (EOEntity *)entityForObject:(id)object
Returns the entity associated with the provided
enterprise object. Raises an exception if the specified entity can't
be found.See Also: - entityForClass:, - entityNamed:
- (EOEntity *)entityNamed:(NSString
*)entityName
Returns the entity with the specified name. Raises an
exception if the specified entity can't be found.See
Also: - entityForClass:, - entityForObject:
- (NSDictionary *)executeStoredProcedureNamed:(NSString
*)storedProcedureName
arguments:(NSDictionary *)arguments
Executes the specified stored procedure with
the provided arguments. Returns the stored procedure's return
values (if any). Use only with stored procedures that don't return
results rows. See Also: - rawRowsWithStoredProcedureNamed:arguments:
- (id)localInstanceOfObject:(id)object
Translates the specified enterprise object from
another editing context to the specified one.See
Also: - localInstancesOfObjects:
- (NSArray *)localInstancesOfObjects:(NSArray
*)objects
Translates the specified enterprise objects
from another editing context to the specified one.See
Also: - localInstanceOfObject:
- (EOModelGroup *)modelGroup
Returns the model group associated with the
editing context's root object store, an EOObjectStoreCoordinator.
- (id)objectFromRawRow:(NSDictionary
*)row
entityNamed:(NSString *)entityName
Fetches and returns the object corresponding
to the specified raw row (using EOEditingContext's faultForRawRow:entityNamed:).
This method can only be used on raw rows that include the row's primary
key.
- (id)objectMatchingValue:(id)value
forKey:(NSString *)key
entityNamed:(NSString *)entityName
Creates an EOKeyValueQualifier with the specified
key and value and returns matching enterprise objects. Raises an EOMoreThanOneException
unless
exactly one object is retrieved.See Also: - objectMatchingValues:entityNamed:, - objectsMatchingValue:forKey:entityNamed:
- (id)objectMatchingValues:(NSDictionary
*)values
entityNamed:(NSString *)entityName
Creates EOKeyValueQualifiers for each key-value
pair in the specified dictionary, ANDs these qualifiers together
into an EOAndQualifier, and returns matching enterprise objects. Raises an EOMoreThanOneException
unless
exactly one object is retrieved.See Also: - objectMatchingValue:forKey:entityNamed:, - objectsMatchingValues:entityNamed:
- (NSArray *)objectsForEntityNamed:(NSString
*)entityName
Fetches and returns the enterprise objects associated
with the specified entity.See Also: - objectsForEntityNamed:qualifierFormat:, - objectsMatchingValue:forKey:entityNamed:, - objectsMatchingValues:entityNamed:
- (NSArray *)objectsMatchingValue:(id)value
forKey:(NSString *)key
entityNamed:(NSString *)entityName
Creates an EOKeyValueQualifier with the specified
key and value and returns matching enterprise objects.See
Also: - objectMatchingValue:forKey:entityNamed:, - objectsForEntityNamed:, - objectsMatchingValues:entityNamed:
- (NSArray *)objectsMatchingValues:(NSDictionary
*)values
entityNamed:(NSString *)entityName
Creates EOKeyValueQualifiers for each key-value
pair in the specified dictionary, ANDs these qualifiers together
into an EOAndQualifier, and returns matching enterprise objects.See
Also: - objectMatchingValues:entityNamed:, - objectsForEntityNamed:, - objectsMatchingValue:forKey:entityNamed:
- (NSArray *)objectsOfClass:(Class)classObject
Fetches and returns the enterprise objects associated
with the specified class. Raises an EOMoreThanOneException
if
more than one entity for the class exists.See
Also: - entityForClass:
- (NSArray *)objectsWithFetchSpecificationNamed:(NSString
*)fetchSpecName
entityNamed:(NSString *)entityName
bindings:(NSDictionary *)bindings
Fetches and returns the enterprise objects retrieved
with the specified fetch specification and bindings.See
Also: - objectWithFetchSpecificationNamed:entityNamed:bindings:
- (NSArray *)objectsForEntityNamed:(NSString
*)entityName
qualifierFormat:(NSString *)format,
...
Creates a qualifier with the provided format
string and arguments, and returns matching enterprise objects.See
Also: - objectForEntityNamed:qualifierFormat:, - objectsForEntityNamed:
- (id)objectWithFetchSpecificationNamed:(NSString
*)fetchSpecName
entityNamed:(NSString *)entityName
bindings:(NSDictionary *)bindings
Fetches and returns the enterprise objects retrieved
with the specified fetch specification and bindings. Raises an EOMoreThanOneException
unless
exactly one object is retrieved.See Also: - objectsWithFetchSpecificationNamed:entityNamed:bindings:
- (id)objectWithPrimaryKey:(NSDictionary
*)keyDictionary
entityNamed:(NSString *)entityName
Fetches and returns the enterprise object identified
by the specified primary key dictionary. Raises an EOMoreThanOneException
unless
exactly one object is retrieved.See Also: - objectMatchingValue:forKey:entityNamed:, - objectWithPrimaryKeyValue:entityNamed:, - primaryKeyForObject:
- (id)objectWithPrimaryKeyValue:(id)value
entityNamed:(NSString *)entityName
Fetches and returns the enterprise object identified
by the specified primary key value. For use only with enterprise
objects that have non-compound primary keys. Raises an EOMoreThanOneException
unless
exactly one object is retrieved.See Also: - objectsMatchingValues:entityNamed:, - objectWithPrimaryKey:entityNamed:
- (id)objectForEntityNamed:(NSString
*)entityName
qualifierFormat:(NSString *)format,
...
Creates a qualifier with the provided format
string and arguments, and returns matching enterprise objects. Raises an EOMoreThanOneException
unless
exactly one object is retrieved.See Also: - objectsForEntityNamed:qualifierFormat:, - rawRowsForEntityNamed:qualifierFormat:
- (NSDictionary *)primaryKeyForObject:(id)object
Returns the primary key dictionary for the specified
enterprise object.See Also: - objectWithPrimaryKey:entityNamed:, - objectWithPrimaryKeyValue:entityNamed:
- (NSArray *)rawRowsWithSQL:(NSString
*)sqlString
modelNamed:(NSString *)modelName
Evaluates the specified SQL and returns the
resulting raw rows.See Also: - rawRowsForEntityNamed:qualifierFormat:, - rawRowsWithStoredProcedureNamed:arguments:
- (NSArray *)rawRowsWithStoredProcedureNamed:(NSString
*)storedProcedureName
arguments:(NSDictionary *)arguments
Executes the specified stored procedure with
the provided arguments and returns the resulting raw rows.See
Also: - rawRowsWithSQL:modelNamed:
- (NSArray *)rawRowsMatchingValue:(id)value
forKey:(NSString *)key
entityNamed:(NSString *)entityName
Creates an EOKeyValueQualifier with the specified
key and value and returns matching raw rows.See
Also: - objectMatchingValue:forKey:entityNamed:, - objectsMatchingValue:forKey:entityNamed:, - rawRowsMatchingValues:entityNamed:
- (NSArray *)rawRowsMatchingValues:(NSDictionary
*)values
entityNamed:(NSString *)entityName
Creates EOKeyValueQualifiers for each key-value
pair in the specified dictionary, ANDs these qualifiers together
into an EOAndQualifier, and returns matching raw rows.See
Also: - objectMatchingValues:entityNamed:, - objectsMatchingValues:entityNamed:, - rawRowsMatchingValue:forKey:entityNamed:
- (NSArray *)rawRowsForEntityNamed:(NSString
*)entityName
qualifierFormat:(NSString *)format,
...
Creates a qualifier for the specified entity
and with the specified qualifier format and returns matching raw
row dictionaries.See Also: - objectsForEntityNamed:qualifierFormat:, - rawRowsWithSQL:modelNamed: