|
Project Wonder 2.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object er.extensions.ERXEOAccessUtilities
Collection of EOAccess related utilities.
Field Summary | |
protected static NSArray |
entityNames
Finds an entity that is contained in a string. |
static ERXLogger |
log
logging support |
Constructor Summary | |
ERXEOAccessUtilities()
|
Method Summary | |
static NSArray |
classPropertiesNotInParent(EOEntity entity,
boolean includeAttributes,
boolean includeToOneRelationships,
boolean includeToManyRelationships)
|
static boolean |
closeDatabaseConnections(EOObjectStoreCoordinator osc)
Closes the (JDBC) Connection from all database channels for the specified EOObjectStoreCoordinator |
static EOAttribute |
createAggregateAttribute(EOEditingContext ec,
String function,
String attributeName,
String entityName)
Creates an aggregate attribute for a given function name. |
static String |
createSchemaSQLForEntitiesInModelWithName(NSArray entities,
String modelName)
creates SQL to create tables for the specified Entities. |
static String |
createSchemaSQLForEntitiesInModelWithNameAndOptions(NSArray entities,
String modelName,
NSDictionary optionsCreate)
creates SQL to create tables for the specified Entities. |
static EODatabaseContext |
databaseContextForEntityNamed(EOObjectStoreCoordinator osc,
String entityName)
Returns the database context for the given entity in the given EOObjectStoreCoordinator |
static EOEntity |
destinationEntityForKeyPath(EOEntity entity,
String keyPath)
Returns the last entity for the given key path. |
static EOEntity |
entityForEo(EOEnterpriseObject eo)
Returns the EOEntity for the provided EOEnterpriseObject if one exists |
static EOEntity |
entityMatchingString(EOEditingContext ec,
String string)
|
static EOEntity |
entityNamed(EOEditingContext ec,
String entityName)
Similar to the helper in EUUtilities, but allows for null editingContext. |
static boolean |
entityWithNamedIsShared(EOEditingContext ec,
String entityName)
Method used to determine if a given entity is a shared entity. |
static void |
evaluateSQLWithEntity(EOEditingContext ec,
EOEntity entity,
String exp)
Utility method used to execute arbitrary SQL. |
static void |
evaluateSQLWithEntityNamed(EOEditingContext ec,
String entityName,
String exp)
Utility method used to execute arbitrary SQL. |
static Number |
getNextValFromSequenceNamed(EOEditingContext ec,
String modelName,
String sequenceName)
Convenience method to get the next unique ID from a sequence. |
static EOModelGroup |
modelGroup(EOEditingContext ec)
Similar to the helper in EUUtilities, but allows for null editingContext. |
static NSDictionary |
primaryKeyDictionaryForEntity(EOEditingContext ec,
String entityName)
Utility method to generate a new primary key dictionary using the adaptor for a given entity. |
static NSArray |
primaryKeysForObjects(NSArray eos)
Creates an array containing all of the primary keys of the given objects. |
static NSArray |
rawRowsForSQLExpression(EOEditingContext ec,
String modelName,
EOSQLExpression expression)
Returns the raw rows for the given EOSQLExpression. |
static boolean |
recoverFromAdaptorException(EOEditingContext editingContext,
EOGeneralAdaptorException exception)
Tries to recover from a EOGeneralAdaptorException . |
static int |
rowCountForFetchSpecification(EOEditingContext ec,
EOFetchSpecification spec)
Returns the number of rows the supplied EOFetchSpecification would return. |
static NSArray |
snapshotsForObjectsFromRelationshipNamed(NSArray eos,
String relKey)
Given an array of EOs, returns snapshot dictionaries for the given related objects. |
static EOSQLExpression |
sqlExpressionForFetchSpecification(EOEditingContext ec,
EOFetchSpecification spec,
long start,
long end)
Creates the SQL which is used by the provided EOFetchSpecification, limited by the given range. |
static String |
sqlForFetchSpecification(EOEditingContext ec,
EOFetchSpecification spec)
Creates the SQL which is used by the provides EOFetchSpecification. |
static String |
sqlWhereClauseStringForKey(EOSQLExpression e,
String key,
NSArray valueArray)
Creates a where clause string " someKey IN ( someValue1,...)". |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final ERXLogger log
protected static NSArray entityNames
Constructor Detail |
public ERXEOAccessUtilities()
Method Detail |
public static EOEntity entityMatchingString(EOEditingContext ec, String string)
public static boolean entityWithNamedIsShared(EOEditingContext ec, String entityName)
ec
- editing contextentityName
- name of the entity
public static Number getNextValFromSequenceNamed(EOEditingContext ec, String modelName, String sequenceName)
ec
- editing contextmodelName
- name of the model which connects to the database that has the
sequence in itsequenceName
- name of the sequence
public static void evaluateSQLWithEntityNamed(EOEditingContext ec, String entityName, String exp)
EOUtilities
rawRowsForSQL
in that it can be used with other statements
besides just SELECT without throwing exceptions.
ec
- editing context that determines which model group and database
context to use.entityName
- name of an entity in the model connected to the database you
wish to execute SQL againstexp
- SQL expressionpublic static void evaluateSQLWithEntity(EOEditingContext ec, EOEntity entity, String exp)
EOUtilities
rawRowsForSQL
in that it can be used with other statements
besides just SELECT without throwing exceptions.
ec
- editing context that determines which model group and database
context to use.entity
- an entity in the model connected to the database you wish to
execute SQL againstexp
- SQL expressionpublic static String sqlForFetchSpecification(EOEditingContext ec, EOFetchSpecification spec)
ec
- the EOEditingContextspec
- the EOFetchSpecification in question
public static NSArray rawRowsForSQLExpression(EOEditingContext ec, String modelName, EOSQLExpression expression)
ec
- the EOEditingContextmodelName
- the name of the model in questionexpression
- the EOSQLExpression in question
public static EOSQLExpression sqlExpressionForFetchSpecification(EOEditingContext ec, EOFetchSpecification spec, long start, long end)
ec
- the EOEditingContextspec
- the EOFetchSpecification in questionstart
- start of rows to fetchend
- end of rows to fetch (-1 if not used)
public static int rowCountForFetchSpecification(EOEditingContext ec, EOFetchSpecification spec)
ec
- the EOEditingContextspec
- the EOFetchSpecification in question
public static EOModelGroup modelGroup(EOEditingContext ec)
ec
- editing context used to locate the model group (can be null)public static EOEntity entityNamed(EOEditingContext ec, String entityName)
ec
- editing context used to locate the model group (can be null)entityName
- entity namepublic static EOAttribute createAggregateAttribute(EOEditingContext ec, String function, String attributeName, String entityName)
ec
- editing context used to locate the model groupfunction
- name of the function MAX, MIN, etcattributeName
- name of the attributeentityName
- name of the entity
public static String createSchemaSQLForEntitiesInModelWithNameAndOptions(NSArray entities, String modelName, NSDictionary optionsCreate)
entities
- a NSArray containing the entities for which create table
statements should be generated or null if all entitites in the
model should be used.modelName
- the name of the EOModeloptionsCreate
- a NSDictionary containing the different options. Possible keys
are
YES
and NO
String
containing SQL statements to create
tablespublic static String createSchemaSQLForEntitiesInModelWithName(NSArray entities, String modelName)
entities
- a NSArray containing the entities for which create table
statements should be generated or null if all entitites in the
model should be used.modelName
- the name of the EOModel YES
and NO
String
containing SQL statements to create
tablespublic static boolean recoverFromAdaptorException(EOEditingContext editingContext, EOGeneralAdaptorException exception)
EOGeneralAdaptorException
.
exception
- the exception as recieved from saveChanges()editingContext
- editing context that created the error
public static NSArray snapshotsForObjectsFromRelationshipNamed(NSArray eos, String relKey)
public static NSDictionary primaryKeyDictionaryForEntity(EOEditingContext ec, String entityName)
ERXGeneratesPrimaryKeyInterface
for more information about using
a newly created dictionary as the primary key for an enterprise object.
ec
- editing contextentityName
- name of the entity to generate the primary key dictionary for.
public static NSArray primaryKeysForObjects(NSArray eos)
eos
- array of enterprise objectspublic static String sqlWhereClauseStringForKey(EOSQLExpression e, String key, NSArray valueArray)
public static EODatabaseContext databaseContextForEntityNamed(EOObjectStoreCoordinator osc, String entityName)
entityName
- osc
-
public static boolean closeDatabaseConnections(EOObjectStoreCoordinator osc)
public static EOEntity destinationEntityForKeyPath(EOEntity entity, String keyPath)
entity
- keyPath
-
public static EOEntity entityForEo(EOEnterpriseObject eo)
eo
- the EOEnterpriseObject
public static NSArray classPropertiesNotInParent(EOEntity entity, boolean includeAttributes, boolean includeToOneRelationships, boolean includeToManyRelationships)
|
Last updated: Do, Dez 9, 2004 12:46 PM CET | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |