WebObjects 5.2

com.webobjects.eoaccess
Class EOUtilities

java.lang.Object
  |
  +--com.webobjects.eoaccess.EOUtilities

public class EOUtilities
extends Object

This class is a collection of convenience methods intended to make common operations with EOF easier. It consists entirely of static methods: you never instantiate an EOUtilities object.

Most methods require an EOEditingContext into which the objects should be fetched. This editing context is passed as the first argument to those methods.

Passing of null arguments will result in runtime exceptions, unless otherwise noted.


Inner Class Summary
static class EOUtilities.MoreThanOneException
          This exception is thrown from the methods in EOUtilities, indicating that multiple objects were found in a search that expected exactly one object as result.
 
Constructor Summary
EOUtilities()
           
 
Method Summary
static void connectWithModelNamed(EOEditingContext ec, String name, NSDictionary overrides)
          Connects to the database using the connection information in the specified model augmented by the overrides dictionary.
static EOEnterpriseObject createAndInsertInstance(EOEditingContext ec, String entityName)
          Creates a new Enterprise Object for the specified entity, inserts it into ec, and returns the new object.
static EODatabaseContext databaseContextForModelNamed(EOEditingContext ec, String name)
          Returns the database context used to service the specified model.
static NSDictionary destinationKeyForSourceObject(EOEditingContext ec, EOEnterpriseObject object, String name)
          Returns the foreign key for the rows at the destination of the specified relationship.
static EOEntity entityForClass(EOEditingContext ec, Class theClass)
          Returns the entity associated with the specified class.
static EOEntity entityForObject(EOEditingContext ec, EOEnterpriseObject obj)
          Returns the entity associated with the provided Enterprise Object.
static EOEntity entityNamed(EOEditingContext ec, String name)
          Returns the entity with the specified name.
static NSDictionary executeStoredProcedureNamed(EOEditingContext ec, String name, NSDictionary args)
          Executes the specified stored procedure with the provided arguments.
static EOEnterpriseObject faultWithPrimaryKey(EOEditingContext ec, String entityName, NSDictionary pkDict)
          Returns the Enterprise Object identified by the specified primary key dictionary.
static EOEnterpriseObject faultWithPrimaryKeyValue(EOEditingContext ec, String entityName, Object value)
          Fetches the Enterprise Object identified by the specified primary key value.
static EOEnterpriseObject localInstanceOfObject(EOEditingContext ec, EOEnterpriseObject object)
          Translates the specified Enterprise Object from another editing context to the specified one.
static NSArray localInstancesOfObjects(EOEditingContext ec, NSArray objects)
          Translates the specified Enterprise Objects from another editing context to the specified one.
static EOModelGroup modelGroup(EOEditingContext ec)
          Returns the model group associated with the editing context's root object store, an EOObjectStoreCoordinator.
static EOEnterpriseObject objectFromRawRow(EOEditingContext ec, String name, NSDictionary row)
          Fetches the object corresponding to the specified raw row (using faultForRawRow).
static EOEnterpriseObject objectMatchingKeyAndValue(EOEditingContext ec, String name, String key, Object value)
          Creates an EOKeyValueQualifier with the specified key and value and returns the matching Enterprise Object.
static EOEnterpriseObject objectMatchingValues(EOEditingContext ec, String name, NSDictionary values)
          Creates EOKeyValueQualifiers for each key-value pair in the specified dictionary, ANDs these qualifiers together into an EOAndQualifier, and returns the matching Enterprise Object.
static NSArray objectsForEntityNamed(EOEditingContext ec, String name)
          Fetches the Enterprise Objects associated with the specified entity.
static NSArray objectsMatchingKeyAndValue(EOEditingContext ec, String name, String key, Object value)
          Creates an EOKeyValueQualifier with the specified key and value and returns matching Enterprise Objects.
static NSArray objectsMatchingValues(EOEditingContext ec, String name, NSDictionary values)
          Creates EOKeyValueQualifiers for each key-value pair in the specified dictionary, ANDs these qualifiers together into an EOAndQualifier, and returns matching Enterprise Objects.
static NSArray objectsOfClass(EOEditingContext ec, Class aClass)
          Fetches the Enterprise Objects associated with the specified class.
static NSArray objectsWithFetchSpecificationAndBindings(EOEditingContext ec, String entityName, String fetchSpecName, NSDictionary bindings)
          Fetches the Enterprise Objects retrieved with the specified fetch specification and bindings.
static NSArray objectsWithQualifierFormat(EOEditingContext ec, String name, String format, NSArray args)
          Creates a qualifier with the provided format string and ordered arguments, and returns matching Enterprise Objects.
static EOEnterpriseObject objectWithFetchSpecificationAndBindings(EOEditingContext ec, String entityName, String fetchSpecName, NSDictionary bindings)
          Fetches the Enterprise Object retrieved with the specified fetch specification and bindings.
static EOEnterpriseObject objectWithPrimaryKey(EOEditingContext ec, String entityName, NSDictionary pkDict)
          Fetches the Enterprise Object identified by the specified primary key dictionary.
static EOEnterpriseObject objectWithPrimaryKeyValue(EOEditingContext ec, String entityName, Object value)
          Fetches the Enterprise Object identified by the specified primary key value.
static EOEnterpriseObject objectWithQualifierFormat(EOEditingContext ec, String name, String format, NSArray args)
          Creates a qualifier with the provided format string and arguments, and returns the matching Enterprise Object.
static NSDictionary primaryKeyForObject(EOEditingContext ec, EOEnterpriseObject object)
          Returns the primary key dictionary for the specified Enterprise Object.
static EOQualifier qualifierForEnterpriseObject(EOEditingContext ec, EOEnterpriseObject object)
          Returns an EOQualifier for the specified Enterprise Object.
static NSArray rawRowsForSQL(EOEditingContext ec, String name, String sqlString)
          Evaluates the specified SQL and returns the resulting raw rows.
static NSArray rawRowsForStoredProcedureNamed(EOEditingContext ec, String name, NSDictionary args)
          Executes the specified stored procedure with the provided arguments and returns the resulting raw rows.
static NSArray rawRowsMatchingKeyAndValue(EOEditingContext ec, String name, String key, Object value)
          Creates an EOKeyValueQualifier with the specified key and value and returns matching raw rows.
static NSArray rawRowsMatchingValues(EOEditingContext ec, String name, NSDictionary values)
          Creates EOKeyValueQualifiers for each key-value pair in the specified dictionary, ANDs these qualifiers together into an EOAndQualifier, and returns matching raw rows.
static NSArray rawRowsWithQualifierFormat(EOEditingContext ec, String name, String format, NSArray args)
          Creates a qualifier for the specified entity and with the specified qualifier format and returns matching raw row dictionaries.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EOUtilities

public EOUtilities()
Method Detail

connectWithModelNamed

public static void connectWithModelNamed(EOEditingContext ec,
                                         String name,
                                         NSDictionary overrides)
Connects to the database using the connection information in the specified model augmented by the overrides dictionary. This method facilitates per-session database logins in WebObjects applications. Typically, you will put a login name and password in the overrides dictionary and otherwise use the values in the model's connection dictionary.
Parameters:
ec - the EOEditingContext to be used to connect
name - the model name
overrides - an NSDictionary that overrides the model's connection dictionary
Throws:
EOObjectNotAvailableException - if the connection attempt failed

createAndInsertInstance

public static EOEnterpriseObject createAndInsertInstance(EOEditingContext ec,
                                                         String entityName)
Creates a new Enterprise Object for the specified entity, inserts it into ec, and returns the new object.
Parameters:
ec - an EOEditingContext
entityName - the name of entity
Returns:
the new Enterprise Object

databaseContextForModelNamed

public static EODatabaseContext databaseContextForModelNamed(EOEditingContext ec,
                                                             String name)
Returns the database context used to service the specified model.
Parameters:
ec - the EOEditingContext
name - the name of model
Returns:
the EODatabaseContext used to service the specified model
Throws:
EOObjectNotAvailableException - if the model name is not registered with the EOEditingContext ec

destinationKeyForSourceObject

public static NSDictionary destinationKeyForSourceObject(EOEditingContext ec,
                                                         EOEnterpriseObject object,
                                                         String name)
Returns the foreign key for the rows at the destination 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.

Parameters:
ec - the EOEditingContext to be queried
object - source EOEnterpriseObject
name - name of the relationship
Returns:
an NSDictionary of foreign key values for the destination
Throws:
EOObjectNotAvailableException - if ec doesn't have information that the entity object has a relationship called name
See Also:
primaryKeyForObject(com.webobjects.eocontrol.EOEditingContext, com.webobjects.eocontrol.EOEnterpriseObject)

entityForClass

public static EOEntity entityForClass(EOEditingContext ec,
                                      Class theClass)
Returns the entity associated with the specified class. Throws an exception if the specified entity can't be found or if more than one entity is associated with the class.
Parameters:
ec - the EOEditingContext to be queried
theClass - a Java Class
Throws:
EOObjectNotAvailableException - if there is no matching object
EOUtilities.MoreThanOneException - if there are more than one matching objects
See Also:
entityForObject(com.webobjects.eocontrol.EOEditingContext, com.webobjects.eocontrol.EOEnterpriseObject), entityNamed(com.webobjects.eocontrol.EOEditingContext, java.lang.String), objectsOfClass(com.webobjects.eocontrol.EOEditingContext, java.lang.Class)

entityForObject

public static EOEntity entityForObject(EOEditingContext ec,
                                       EOEnterpriseObject obj)
Returns the entity associated with the provided Enterprise Object. Throws an exception if the specified entity can't be found.
Parameters:
ec - the EOEditingContext to be queried
obj - an EOEnterpriseObject
Throws:
IllegalArgumentException - if the class description of obj as returned by EOEnterpriseObject.classDescription is not an instance of type EOEntityClassDescription
See Also:
entityForClass(com.webobjects.eocontrol.EOEditingContext, java.lang.Class), entityNamed(com.webobjects.eocontrol.EOEditingContext, java.lang.String), EOEnterpriseObject.classDescription(), EOEntityClassDescription

entityNamed

public static EOEntity entityNamed(EOEditingContext ec,
                                   String name)
Returns the entity with the specified name.
Parameters:
ec - the EOEditingContext to be queried
name - the name of the entity
Throws:
EOObjectNotAvailableException - if no entity with that name exists
See Also:
entityForClass(com.webobjects.eocontrol.EOEditingContext, java.lang.Class), entityForObject(com.webobjects.eocontrol.EOEditingContext, com.webobjects.eocontrol.EOEnterpriseObject)

executeStoredProcedureNamed

public static NSDictionary executeStoredProcedureNamed(EOEditingContext ec,
                                                       String name,
                                                       NSDictionary args)
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.
Parameters:
ec - an EOEditingContext
name - the name of the stored procedure to call
args - an NSDictionary of arguments (values keyed by argument name)
Returns:
the stored procedure return value in an NSDictionary
See Also:
rawRowsForStoredProcedureNamed(com.webobjects.eocontrol.EOEditingContext, java.lang.String, com.webobjects.foundation.NSDictionary)

faultWithPrimaryKey

public static EOEnterpriseObject faultWithPrimaryKey(EOEditingContext ec,
                                                     String entityName,
                                                     NSDictionary pkDict)
Returns the Enterprise Object identified by the specified primary key dictionary. The result may be a fault. It is not an error for the fault to refer to a nonexistent row but such a fault may eventually cause an exception to be raised if it is ever fired.
Parameters:
ec - the EOEditingContext to used to resolve the query
entityName -  
pkDict -  
Returns:
the Enterprise Object identified by the specified primary key dictionary

faultWithPrimaryKeyValue

public static EOEnterpriseObject faultWithPrimaryKeyValue(EOEditingContext ec,
                                                          String entityName,
                                                          Object value)
Fetches the Enterprise Object identified by the specified primary key value. For use only with Enterprise Objects that have non-compound primary keys. The result may be a fault. It is not an error for the fault to refer to a nonexistent row but such a fault may eventually cause an exception to be raised if it is ever fired.
Parameters:
ec - an EOEditingContext
name -  
value -  
Returns:
matching Enterprise Object
Throws:
java.lang.IllegalArgumentException - if the primary key is not formed by exactly one attribute

localInstanceOfObject

public static EOEnterpriseObject localInstanceOfObject(EOEditingContext ec,
                                                       EOEnterpriseObject object)
Translates the specified Enterprise Object from another editing context to the specified one.
Parameters:
ec - the desired EOEditingContext
object - an Enterprise Object in another EOEditingContext
Returns:
an Enterprise Object registered with ec, or null if the object parameter is null
Throws:
IllegalArgumentException - if object is not associated with an EOEditingContext
See Also:
localInstancesOfObjects(com.webobjects.eocontrol.EOEditingContext, com.webobjects.foundation.NSArray)

localInstancesOfObjects

public static NSArray localInstancesOfObjects(EOEditingContext ec,
                                              NSArray objects)
Translates the specified Enterprise Objects from another editing context to the specified one.
Parameters:
ec - the desired EOEditingContext
objects - an NSArray of EOEnterpriseObjects in another EOEditingContext
Returns:
an array of Enterprise Objects registered with ec
Throws:
IllegalArgumentException - if any of the objects contained in objects is not associated with an EOEditingContext
See Also:
localInstanceOfObject(com.webobjects.eocontrol.EOEditingContext, com.webobjects.eocontrol.EOEnterpriseObject)

modelGroup

public static EOModelGroup modelGroup(EOEditingContext ec)
Returns the model group associated with the editing context's root object store, an EOObjectStoreCoordinator.
Parameters:
ec - the EOEditingContext
Returns:
the model group associated with the editing context's root object store
Throws:
IllegalArgumentException - if the root object store of ec as returned by EOEditingContext.rootObjectStore is not an instance of type EOObjectStoreCoordinator
See Also:
EOEditingContext.rootObjectStore(), EOObjectStoreCoordinator

objectFromRawRow

public static EOEnterpriseObject objectFromRawRow(EOEditingContext ec,
                                                  String name,
                                                  NSDictionary row)
Fetches the object corresponding to the specified raw row (using faultForRawRow). This method can only be used on raw rows that include the row's primary key.
Parameters:
ec - an EOEditingContext
name - name of the entity
row - an NSDictionary of the raw row (or "snapshot")
Returns:
the corresponding Enterprise Object
See Also:
EOEditingContext.faultForRawRow(com.webobjects.foundation.NSDictionary, java.lang.String, com.webobjects.eocontrol.EOEditingContext)

objectMatchingKeyAndValue

public static EOEnterpriseObject objectMatchingKeyAndValue(EOEditingContext ec,
                                                           String name,
                                                           String key,
                                                           Object value)
Creates an EOKeyValueQualifier with the specified key and value and returns the matching Enterprise Object. Throws an exception unless exactly one object is retrieved.
Parameters:
ec - an EOEditingContext
name - the name of the EOEntity
key - the key for the query
value - the value to match
Returns:
the matching Enterprise Object
Throws:
EOObjectNotAvailableException - if there is no matching object
EOUtilities.MoreThanOneException - if there are more than one matching objects
See Also:
objectMatchingValues(com.webobjects.eocontrol.EOEditingContext, java.lang.String, com.webobjects.foundation.NSDictionary), objectsMatchingKeyAndValue(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, java.lang.Object)

objectMatchingValues

public static EOEnterpriseObject objectMatchingValues(EOEditingContext ec,
                                                      String name,
                                                      NSDictionary values)
Creates EOKeyValueQualifiers for each key-value pair in the specified dictionary, ANDs these qualifiers together into an EOAndQualifier, and returns the matching Enterprise Object. Throws an exception unless exactly one object is retrieved.
Parameters:
ec - an EOEditingContext
name - the name of the EOEntity
values - specifies value of Enterprise Object
Returns:
the matching Enterprise Object
Throws:
EOObjectNotAvailableException - if there is no matching object
EOUtilities.MoreThanOneException - if there are more than one matching objects
See Also:
objectMatchingKeyAndValue(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, java.lang.Object), objectsMatchingValues(com.webobjects.eocontrol.EOEditingContext, java.lang.String, com.webobjects.foundation.NSDictionary)

objectWithFetchSpecificationAndBindings

public static EOEnterpriseObject objectWithFetchSpecificationAndBindings(EOEditingContext ec,
                                                                         String entityName,
                                                                         String fetchSpecName,
                                                                         NSDictionary bindings)
Fetches the Enterprise Object retrieved with the specified fetch specification and bindings. Throws an exception unless exactly one object is retrieved.
Parameters:
ec - an EOEditingContext
entityName - the name of the EOEntity
fetchSpecName - the name of the EOFetchSpecification
bindings - an NSDictionary of bindings for the EOFetchSpecification
Returns:
matching Enterprise Object
Throws:
EOObjectNotAvailableException - if there is no matching object
EOUtilities.MoreThanOneException - if there are more than one matching objects
See Also:
objectsWithFetchSpecificationAndBindings(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, com.webobjects.foundation.NSDictionary)

objectWithPrimaryKey

public static EOEnterpriseObject objectWithPrimaryKey(EOEditingContext ec,
                                                      String entityName,
                                                      NSDictionary pkDict)
Fetches the Enterprise Object identified by the specified primary key dictionary. Throws an exception unless exactly one object is retrieved.
Parameters:
ec - an EOEditingContext
entityName - the name of the EOEntity
pkDict - an NSDictionary containing the primary key
Returns:
the Enterprise Object identified by the specified primary key dictionary
Throws:
exception - unless exactly one object is retrieved
See Also:
objectMatchingKeyAndValue(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, java.lang.Object), objectWithPrimaryKeyValue(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.Object), primaryKeyForObject(com.webobjects.eocontrol.EOEditingContext, com.webobjects.eocontrol.EOEnterpriseObject)

objectWithPrimaryKeyValue

public static EOEnterpriseObject objectWithPrimaryKeyValue(EOEditingContext ec,
                                                           String entityName,
                                                           Object value)
Fetches the Enterprise Object identified by the specified primary key value. For use only with enterprise objects that have non-compound primary keys. Throws an exception unless exactly one object is retrieved.
Parameters:
ec - an EOEditingContext
entityName - the name of the EOEntity
value - primary key value
Returns:
matching Enterprise Object
Throws:
java.lang.IllegalArgumentException - if the primary key is not formed by exactly one attribute
EOObjectNotAvailableException - if there is no matching object
EOUtilities.MoreThanOneException - if there are more than one matching objects
See Also:
objectsMatchingValues(com.webobjects.eocontrol.EOEditingContext, java.lang.String, com.webobjects.foundation.NSDictionary), objectWithPrimaryKey(com.webobjects.eocontrol.EOEditingContext, java.lang.String, com.webobjects.foundation.NSDictionary)

objectWithQualifierFormat

public static EOEnterpriseObject objectWithQualifierFormat(EOEditingContext ec,
                                                           String name,
                                                           String format,
                                                           NSArray args)
Creates a qualifier with the provided format string and arguments, and returns the matching Enterprise Object. Throws an exception unless exactly one object is retrieved.
Parameters:
ec - an EOEditingContext
name - the name of the EOEntity
format - format String for the qualifier
args - arguments for the format String
Returns:
the matching Enterprise Object
Throws:
EOObjectNotAvailableException - if there is no matching object
EOUtilities.MoreThanOneException - if there are more than one matching objects
See Also:
objectsWithQualifierFormat(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, com.webobjects.foundation.NSArray), rawRowsWithQualifierFormat(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, com.webobjects.foundation.NSArray)

objectsForEntityNamed

public static NSArray objectsForEntityNamed(EOEditingContext ec,
                                            String name)
Fetches the Enterprise Objects associated with the specified entity.
Parameters:
ec - an EOEditingContext
name - the name of the entity
Returns:
an NSArray of all matching objects
See Also:
objectsWithQualifierFormat(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, com.webobjects.foundation.NSArray), objectsMatchingKeyAndValue(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, java.lang.Object), objectsMatchingValues(com.webobjects.eocontrol.EOEditingContext, java.lang.String, com.webobjects.foundation.NSDictionary)

objectsMatchingKeyAndValue

public static NSArray objectsMatchingKeyAndValue(EOEditingContext ec,
                                                 String name,
                                                 String key,
                                                 Object value)
Creates an EOKeyValueQualifier with the specified key and value and returns matching Enterprise Objects.
Parameters:
ec - an EOEditingContext
entityName - the name of the EOEntity
key - key for query
value - value for property
Returns:
an NSArray of matching Enterprise Objects
See Also:
objectMatchingKeyAndValue(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, java.lang.Object), objectsForEntityNamed(com.webobjects.eocontrol.EOEditingContext, java.lang.String), objectsMatchingValues(com.webobjects.eocontrol.EOEditingContext, java.lang.String, com.webobjects.foundation.NSDictionary)

objectsMatchingValues

public static NSArray objectsMatchingValues(EOEditingContext ec,
                                            String name,
                                            NSDictionary values)
Creates EOKeyValueQualifiers for each key-value pair in the specified dictionary, ANDs these qualifiers together into an EOAndQualifier, and returns matching Enterprise Objects.
Parameters:
ec - an EOEditingContext
name - the name of the EOEntity
values - an NSDictionary of key-value pairs
Returns:
an NSArray of matching Enterprise Objects
See Also:
objectMatchingValues(com.webobjects.eocontrol.EOEditingContext, java.lang.String, com.webobjects.foundation.NSDictionary), objectsForEntityNamed(com.webobjects.eocontrol.EOEditingContext, java.lang.String), objectsMatchingKeyAndValue(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, java.lang.Object)

objectsOfClass

public static NSArray objectsOfClass(EOEditingContext ec,
                                     Class aClass)
Fetches the Enterprise Objects associated with the specified class. Throws an exception if more than one entity for the class exists.
Parameters:
ec - an EOEditingContext
aClass - an EO Class
Returns:
an NSArray of Enterprise Objects
Throws:
EOObjectNotAvailableException - if there no entity for that class
EOUtilities.MoreThanOneException - if there is more than one entity for that class
See Also:
entityForClass(com.webobjects.eocontrol.EOEditingContext, java.lang.Class)

objectsWithFetchSpecificationAndBindings

public static NSArray objectsWithFetchSpecificationAndBindings(EOEditingContext ec,
                                                               String entityName,
                                                               String fetchSpecName,
                                                               NSDictionary bindings)
Fetches the Enterprise Objects retrieved with the specified fetch specification and bindings.
Parameters:
ec - an EOEditingContext
entityName - the name of the EOEntity
fetchSpecName - the name of the EOFetchSpecification for the entity
bindings - an NSDictionary of bindings for EOQualifierVariables in the EOFetchSpecification
Returns:
an NSArray of Enterprise Objects
Throws:
EOObjectNotAvailableException - if the fetch specification fetchSpecName couldn't be found
See Also:
objectWithFetchSpecificationAndBindings(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, com.webobjects.foundation.NSDictionary)

objectsWithQualifierFormat

public static NSArray objectsWithQualifierFormat(EOEditingContext ec,
                                                 String name,
                                                 String format,
                                                 NSArray args)
Creates a qualifier with the provided format string and ordered arguments, and returns matching Enterprise Objects.
Parameters:
ec - an EOEditingContext
entityName - the name of the EOEntity
format - format string for the qualifier
args - an NSArray of arguments for the format string
Returns:
an NSArray of matching Enterprise Objects
See Also:
objectWithQualifierFormat(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, com.webobjects.foundation.NSArray), objectsForEntityNamed(com.webobjects.eocontrol.EOEditingContext, java.lang.String)

primaryKeyForObject

public static NSDictionary primaryKeyForObject(EOEditingContext ec,
                                               EOEnterpriseObject object)
Returns the primary key dictionary for the specified Enterprise Object.

Parameters:
ec - an EOEditingContext containing object
object - the Enterprise Object
Returns:
the primary key of object
See Also:
objectWithPrimaryKey(com.webobjects.eocontrol.EOEditingContext, java.lang.String, com.webobjects.foundation.NSDictionary), objectWithPrimaryKeyValue(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.Object)

qualifierForEnterpriseObject

public static EOQualifier qualifierForEnterpriseObject(EOEditingContext ec,
                                                       EOEnterpriseObject object)
Returns an EOQualifier for the specified Enterprise Object.

Parameters:
ec - an EOEditingContext containing object
object - the Enterprise Object
Returns:
an EOQualifier which specifies object
Throws:
an - IllegalArgumentException if it cannot determine the globalID or entity of object
See Also:
primaryKeyForObject(com.webobjects.eocontrol.EOEditingContext, com.webobjects.eocontrol.EOEnterpriseObject)

rawRowsForSQL

public static NSArray rawRowsForSQL(EOEditingContext ec,
                                    String name,
                                    String sqlString)
Evaluates the specified SQL and returns the resulting raw rows.

Parameters:
ec - an EOEditingContext
name - name of the EOModel to use
sqlString - the query string in SQL syntax
Returns:
matching raw rows
See Also:
rawRowsWithQualifierFormat(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, com.webobjects.foundation.NSArray), rawRowsForStoredProcedureNamed(com.webobjects.eocontrol.EOEditingContext, java.lang.String, com.webobjects.foundation.NSDictionary)

rawRowsForStoredProcedureNamed

public static NSArray rawRowsForStoredProcedureNamed(EOEditingContext ec,
                                                     String name,
                                                     NSDictionary args)
Executes the specified stored procedure with the provided arguments and returns the resulting raw rows.

Parameters:
ec - an EOEditingContext
name - the name of the stored procedure to call
args - input arguments for the procedure
Returns:
matching raw rows
See Also:
rawRowsForSQL(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String)

rawRowsMatchingKeyAndValue

public static NSArray rawRowsMatchingKeyAndValue(EOEditingContext ec,
                                                 String name,
                                                 String key,
                                                 Object value)
Creates an EOKeyValueQualifier with the specified key and value and returns matching raw rows.
Parameters:
ec - an EOEditingContext
name - the name of the EOEntity
key - property key
value - property value
Returns:
matching raw rows
See Also:
objectMatchingKeyAndValue(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, java.lang.Object), objectsMatchingKeyAndValue(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, java.lang.Object), rawRowsMatchingValues(com.webobjects.eocontrol.EOEditingContext, java.lang.String, com.webobjects.foundation.NSDictionary)

rawRowsMatchingValues

public static NSArray rawRowsMatchingValues(EOEditingContext ec,
                                            String name,
                                            NSDictionary values)
Creates EOKeyValueQualifiers for each key-value pair in the specified dictionary, ANDs these qualifiers together into an EOAndQualifier, and returns matching raw rows.
Parameters:
ec - an EOEditingContext
name - the name of the EOEntity
values - an NSDictionary of key-value pairs
Returns:
matching raw rows
See Also:
objectMatchingValues(com.webobjects.eocontrol.EOEditingContext, java.lang.String, com.webobjects.foundation.NSDictionary), objectsMatchingValues(com.webobjects.eocontrol.EOEditingContext, java.lang.String, com.webobjects.foundation.NSDictionary), rawRowsMatchingKeyAndValue(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, java.lang.Object)

rawRowsWithQualifierFormat

public static NSArray rawRowsWithQualifierFormat(EOEditingContext ec,
                                                 String name,
                                                 String format,
                                                 NSArray args)
Creates a qualifier for the specified entity and with the specified qualifier format and returns matching raw row dictionaries.
Parameters:
ec - an EOEditingContext
name - the name of the EOEntity
format - format String
args - an NSArray of arguments for the format String
Returns:
matching raw rows
See Also:
objectsWithQualifierFormat(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String, com.webobjects.foundation.NSArray), rawRowsForSQL(com.webobjects.eocontrol.EOEditingContext, java.lang.String, java.lang.String)

Last updated Fri Feb 21 13:15:00 PST 2003.

Copyright © 2003 Apple Computer, Inc.