Documentation Archive Developer
Search
PATH  WebObjects 4.0 Documentation > EOAccess Reference



EOEditingContext Additions

(informal protocol)

EOEditingContext

Declared in: EOAccess/EOUtilities.h


Class Description

EOEditingContext Additions is a collection of convenience methods intended to make common operations with EOF easier. EOEditingContext Additions is a category on EOEditingContext provided in EOAccess.

Note: 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

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


connectWithModelNamed:connectionDictionaryOverrides:

- (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.


databaseContextForModelNamed:

- (EODatabaseContext *)databaseContextForModelNamed:(NSString *)entityName

Returns the database context used to service the specified model.


destinationKeyForSourceObject:relationshipNamed:

- (NSDictionary *)destinationKeyForSourceObject:(id)object
relationshipNamed:(NSString *)entityName

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 Employee.deptID, invoking this method on a Department object with ID equal to 5 will return a dictionary with a value of 5 for the deptID key.

See also: - primaryKeyForObject:


entityForClass:

- (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:


entityForObject:

- (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:


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:


executeStoredProcedureNamed:arguments:

- (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:


localInstanceOfObject:

- (id)localInstanceOfObject:(id)object

Translates the specified enterprise object from another editing context to the specified one.

See also: - localInstancesOfObjects:


localInstancesOfObjects:

- (NSArray *)localInstancesOfObjects:(NSArray *)objects

Translates the specified enterprise objects from another editing context to the specified one.

See also: - localInstanceOfObject:


modelGroup

- (EOModelGroup *)modelGroup

Returns the model group associated with the editing context's root object store, an EOObjectStoreCoordinator.


objectForEntityNamed:qualifierFormat:

- (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:


objectFromRawRow:entityNamed:

- (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.


objectMatchingValue:forKey:entityNamed:

- (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:


objectMatchingValues: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:


objectsForEntityNamed:

- (NSArray *)objectsForEntityNamed:(NSString *)entityName

Fetches and returns the enterprise objects associated with the specified entity.

See also: - objectsForEntityNamed:qualifierFormat:, - objectsMatchingValue:forKey:entityNamed:, - objectsMatchingValues:entityNamed:


objectsForEntityNamed:qualifierFormat:

- (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:


objectsMatchingValue:forKey: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:


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:


objectsOfClass:

- (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:


objectsWithFetchSpecificationNamed:entityNamed:bindings:

- (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:


objectWithFetchSpecificationNamed:entityNamed:bindings:

- (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:


objectWithPrimaryKey:entityNamed:

- (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:


objectWithPrimaryKeyValue:entityNamed:

- (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:


primaryKeyForObject:

- (NSDictionary *)primaryKeyForObject:(id)object

Returns the primary key dictionary for the specified enterprise object.

See also: - objectWithPrimaryKey:entityNamed:, - objectWithPrimaryKeyValue:entityNamed:


rawRowsForEntityNamed:qualifierFormat:

- (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:


rawRowsMatchingValue:forKey:entityNamed:

- (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:


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:


rawRowsWithSQL:modelNamed:

- (NSArray *)rawRowsWithSQL:(NSString *)sqlString modelNamed:(NSString *)modelName

Evaluates the specified SQL and returns the resulting raw rows.

See also: - rawRowsForEntityNamed:qualifierFormat:, - rawRowsWithStoredProcedureNamed: arguments:


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:





Copyright © 1998, Apple Computer, Inc. All rights reserved.