|
WebObjects 5.2.3 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface has been introduced to define API for generating database schemas from EOModel files. None of the API is new in WebObjects 5.x. Rather, it was moved to EOSchemaGeneration from EOSQLExpression. The API is essentially the same as in WebObjects 4.5.x except that methods that were static methods of EOSQLExpression in WebObjects 4.5.x are now are instance methods on EOSchemaGeneration.
An implementation of the EOSchemaGeneration interface is provided by EOSynchronizationFactory, a new class introduced in WebObjects 5.0.
EOSchemaGeneration defines a number of constants that are intended
for use as keys in options dictionaries. A corresponding value of
"YES"
indicates that the EOSQLExpression should generate
SQL to perform the corresponding database operation.
EOSQLExpression
,
EOSynchronizationFactory
Field Summary | |
static String |
CreateDatabaseKey
Options dictionary key whose value determines whether the EOSQLExpression should generate SQL to create a database. |
static String |
CreatePrimaryKeySupportKey
Options dictionary key whose value determines whether the EOSQLExpression should generate SQL to create primary key support. |
static String |
CreateTablesKey
Options dictionary key whose value determines whether the EOSQLExpression should generate SQL to create tables. |
static String |
DropDatabaseKey
Options dictionary key whose value determines whether the EOSQLExpression should generate SQL to drop a database. |
static String |
DropPrimaryKeySupportKey
Options dictionary key whose value determines whether the EOSQLExpression should generate SQL to drop primary key support. |
static String |
DropTablesKey
Options dictionary key whose value determines whether the EOSQLExpression should generate SQL to drop tables. |
static String |
ForeignKeyConstraintsKey
Options dictionary key whose value determines whether the EOSQLExpression should generate SQL to create foreign key constraints. |
static String |
PrimaryKeyConstraintsKey
Options dictionary key whose value determines whether the EOSQLExpression should generate SQL to create primary key constraints. |
Method Summary | |
void |
appendExpressionToScript(EOSQLExpression expression,
StringBuffer script)
Appends expression 's statement to script
along with any necessary delimiter. |
NSArray |
createDatabaseStatementsForConnectionDictionary(NSDictionary connectionDictionary,
NSDictionary administrativeConnectionDictionary)
Generates and returns an array of EOSQLExpressions containing the SQL statements to create a database or user that can be accessed by the provided connectionDictionary and
administrativeConnectionDictionary . |
NSArray |
createTableStatementsForEntityGroup(NSArray entityGroup)
Returns an array of EOSQLExpression objects that define the SQL necessary to create a table for entityGroup . |
NSArray |
createTableStatementsForEntityGroups(NSArray entityGroups)
Returns an array of EOSQLExpression objects that define the SQL necessary to create the tables for each of the entity groups in entityGroups . |
NSArray |
dropDatabaseStatementsForConnectionDictionary(NSDictionary connectionDictionary,
NSDictionary administrativeConnectionDictionary)
Generates and returns an array of EOSQLExpressions that define the SQL statements to drop a database or user that is accessed by the provided connectionDictionary and
administrativeConnectionDictionary . |
NSArray |
dropPrimaryKeySupportStatementsForEntityGroup(NSArray entityGroup)
Returns an array of EOSQLExpression objects that define the SQL necessary to drop the primary key generation support for entityGroup , or null if primary key
generation is not supported. |
NSArray |
dropPrimaryKeySupportStatementsForEntityGroups(NSArray entityGroups)
Returns an array of EOSQLExpression objects that define the SQL necessary to drop the primary key generation support for all the entities in each of the the entity groups in entityGroups . |
NSArray |
dropTableStatementsForEntityGroup(NSArray entityGroup)
Returns an array of EOSQLExpression objects that define the SQL necessary to drop the table identified by entityGroup . |
NSArray |
dropTableStatementsForEntityGroups(NSArray entityGroups)
Returns an array of EOSQLExpression objects that define the SQL necessary to drop the tables for all the entity groups in entityGroups . |
NSArray |
foreignKeyConstraintStatementsForRelationship(EORelationship relationship)
Returns an array of EOSQLExpression objects that define the SQL statements necessary to create foreign key constraints for relationship . |
NSArray |
primaryKeyConstraintStatementsForEntityGroup(NSArray entityGroup)
Returns an array of EOSQLExpression objects that define the SQL necessary to create the primary key constraints for entityGroup . |
NSArray |
primaryKeyConstraintStatementsForEntityGroups(NSArray entityGroups)
Returns an array of EOSQLExpression objects that define the SQL necessary to create the primary key constraints for the entities specified in entityGroups . |
NSArray |
primaryKeySupportStatementsForEntityGroup(NSArray entityGroup)
Returns an array of EOSQLExpression objects that define the SQL necessary to create the primary key generation support for entityGroup , or null if primary key
generation is not supported. |
NSArray |
primaryKeySupportStatementsForEntityGroups(NSArray entityGroups)
Returns an array of EOSQLExpression objects that define the SQL necessary to create the primary key generation support for all the entities in each of the the entity groups in entityGroups . |
String |
schemaCreationScriptForEntities(NSArray allEntities,
NSDictionary options)
Returns a script of SQL statements suitable to create the schema based on options for the EOEntity objects in
allEntities . |
NSArray |
schemaCreationStatementsForEntities(NSArray allEntities,
NSDictionary options)
Returns an array of EOSQLExpressions suitable to create the schema based on options for the EOEntity objects in
allEntities . |
Field Detail |
public static final String CreateDatabaseKey
public static final String CreatePrimaryKeySupportKey
public static final String CreateTablesKey
public static final String DropDatabaseKey
public static final String DropPrimaryKeySupportKey
public static final String DropTablesKey
public static final String ForeignKeyConstraintsKey
public static final String PrimaryKeyConstraintsKey
Method Detail |
public void appendExpressionToScript(EOSQLExpression expression, StringBuffer script)
expression
's statement to script
along with any necessary delimiter. script
is the
StringBuffer in which the SQL script is built.
Used in conjunction with
schemaCreationStatementsForEntities
and
schemaCreationScriptForEntities
to build up the
SQL script to generate the specified schema for a set of EOEntities.
expression
- An EOSQLExpression.script
- A StringBuffer used to build the SQL script.createTableStatementsForEntityGroup(
NSArray entityGroup)
,
EOSynchronizationFactory.appendExpressionToScript(
EOSQLExpression expression, StringBuffer script)
,
EOSQLExpression
public NSArray createDatabaseStatementsForConnectionDictionary(NSDictionary connectionDictionary, NSDictionary administrativeConnectionDictionary)
connectionDictionary
and
administrativeConnectionDictionary
. Returns
null
if this feature is not supported.
connectionDictionary
- A dictionary of
information needed by the
adaptor to connect to the
database server.administrativeConnectionDictionary
- A dictionary of
administrative login
information for the
database server.
dropDatabaseStatementsForConnectionDictionary(
NSDictionary connectionDictionary,
NSDictionary administrativeConnectionDictionary)
public NSArray createTableStatementsForEntityGroup(NSArray entityGroup)
entityGroup
. Returns
an empty array if entityGroup
is null
or empty.
entityGroup
- An array of EOEntity objects that have the
same external name.
entityGroup
, or an empty array.createTableStatementsForEntityGroups(
NSArray entityGroup)
,
dropTableStatementsForEntityGroup(
NSArray entityGroup)
,
EOEntity.externalName()
,
EOSynchronizationFactory.createTableStatementsForEntityGroup(
NSArray entityGroup)
public NSArray createTableStatementsForEntityGroups(NSArray entityGroups)
entityGroups
. Returns an empty array if
entityGroups
is null
or empty.
entityGroups
- An array of entity groups, which are arrays
of EOEntity objects that have the same
external name.
entityGroups
, or an
empty array.createTableStatementsForEntityGroup(
NSArray entityGroup)
,
schemaCreationStatementsForEntities(
NSArray allEntities, NSDictionary options)
,
EOEntity.externalName()
,
EOSynchronizationFactory.createTableStatementsForEntityGroups(
NSArray entityGroups)
public NSArray dropDatabaseStatementsForConnectionDictionary(NSDictionary connectionDictionary, NSDictionary administrativeConnectionDictionary)
connectionDictionary
and
administrativeConnectionDictionary
. Returns
null
if this feature is not supported.
connectionDictionary
- A dictionary of
information needed by the
adaptor to connect to the
database server.administrativeConnectionDictionary
- A dictionary of
administrative login
information for the
database server.
createDatabaseStatementsForConnectionDictionary(
NSDictionary connectionDictionary,
NSDictionary administrativeConnectionDictionary)
public NSArray dropPrimaryKeySupportStatementsForEntityGroup(NSArray entityGroup)
entityGroup
, or null
if primary key
generation is not supported.
entityGroup
- An array of EOEntity objects that have the same
external name.
entityGroup
, or
null
.primaryKeySupportStatementsForEntityGroup(
NSArray entityGroup)
,
EOEntity.externalName()
,
EOSynchronizationFactory.dropPrimaryKeySupportStatementsForEntityGroup(
NSArray entityGroup)
public NSArray dropPrimaryKeySupportStatementsForEntityGroups(NSArray entityGroups)
entityGroups
. Returns an empty array if
entityGroups
is null
or empty. Returns
an array containing an error message if primary key generation
support is not available.
entityGroups
- An array of entity groups, which are arrays
of EOEntity objects that have the same
external name.
entityGroups
, or an
empty array, or an array containing an error
string.dropPrimaryKeySupportStatementsForEntityGroup(
NSArray entityGroup)
,
schemaCreationStatementsForEntities(
NSArray allEntities, NSDictionary options)
,
EOAdaptorChannel.primaryKeyForNewRowWithEntity(
EOEntity entity)
,
EOEntity.externalName()
,
EOSynchronizationFactory.dropPrimaryKeySupportStatementsForEntityGroups(
NSArray entityGroups)
public NSArray dropTableStatementsForEntityGroup(NSArray entityGroup)
entityGroup
.
Returns an empty array if entityGroup
is
null
. The drop statement generated by this method
should be sufficient to remove the table created by
createTableStatementsForEntityGroup
's statements.
entityGroup
- An array of EOEntity objects that have the
same external name.
entityGroup
, or
an empty array.createTableStatementsForEntityGroup(NSArray
entityGroup)
,
dropTableStatementsForEntityGroups(NSArray
entityGroups)
,
EOEntity.externalName()
,
EOSynchronizationFactory.dropTableStatementsForEntityGroup(
NSArray entityGroup)
public NSArray dropTableStatementsForEntityGroups(NSArray entityGroups)
entityGroups
. Returns an empty array if
entityGroups
is null
or empty.
entityGroups
- An array of entity groups, which are arrays
of EOEntity objects that have the same
external name.
entityGroups
, or an
empty array.dropTableStatementsForEntityGroup(
NSArray entityGroup)
,
schemaCreationStatementsForEntities(
NSArray allEntities, NSDictionary options)
,
EOEntity.externalName()
,
EOSynchronizationFactory.dropTableStatementsForEntityGroups(
NSArray entityGroups)
public NSArray foreignKeyConstraintStatementsForRelationship(EORelationship relationship)
relationship
. Returns an empty array if unable
to generate foreign key constraints for relationship
relationship
- An EORelationship.
relationship
, or an empty array.EOSQLExpression
,
EOSynchronizationFactory.foreignKeyConstraintStatementsForRelationship(EORelationship relationship)
,
schemaCreationStatementsForEntities(
NSArray allEntities, NSDictionary options)
public NSArray primaryKeyConstraintStatementsForEntityGroup(NSArray entityGroup)
entityGroup
. Returns an empty array if any of the
primary key attributes in entityGroup
don't have a
column name or if entityGroup
is null
.
entityGroup
- An array of EOEntity objects that have the
same external name.
entityGroup
, or an empty array.EOAttribute.columnName()
,
EOEntity.externalName()
,
EOEntity.primaryKeyAttributes()
,
EOSynchronizationFactory.primaryKeyConstraintStatementsForEntityGroup(
NSArray entityGroup)
public NSArray primaryKeyConstraintStatementsForEntityGroups(NSArray entityGroups)
entityGroups
. Returns an empty array if
entityGroups
is null
or empty.
entityGroups
- An array of entity groups, which are arrays
of EOEntity objects that have the same
external name.
entityGroups
, or an empty
array.primaryKeyConstraintStatementsForEntityGroup(
NSArray entityGroup)
,
EOEntity.externalName()
,
EOSynchronizationFactory.primaryKeyConstraintStatementsForEntityGroups(
NSArray entityGroups)
public NSArray primaryKeySupportStatementsForEntityGroup(NSArray entityGroup)
entityGroup
, or null
if primary key
generation is not supported.
entityGroup
- An array of EOEntity objects that have the same
external name.
entityGroup
, or
null>
.dropPrimaryKeySupportStatementsForEntityGroup(
NSArray entityGroup)
,
EOAdaptorChannel.primaryKeyForNewRowWithEntity(
EOEntity entity)
,
EOEntity.externalName()
,
EOSynchronizationFactory.primaryKeySupportStatementsForEntityGroup(
NSArray entityGroup)
public NSArray primaryKeySupportStatementsForEntityGroups(NSArray entityGroups)
entityGroups
. Returns an empty array if
entityGroups
is null
or empty. Returns
an array containing an error message if primary key generation
support is not available.
entityGroups
- An array of entity groups, which are arrays
of EOEntity objects that have the same
external name.
entityGroups
, or an
empty array, or an array containing an error
string.primaryKeySupportStatementsForEntityGroup(
NSArray entityGroup)
,
EOAdaptorChannel.primaryKeyForNewRowWithEntity(
EOEntity entity)
,
EOEntity.externalName()
,
EOSynchronizationFactory.primaryKeySupportStatementsForEntityGroups(
NSArray entityGroups)
public String schemaCreationScriptForEntities(NSArray allEntities, NSDictionary options)
options
for the EOEntity objects in
allEntities
. Returns an empty string if either
options
or allEntities
is empty or
null
.
options
is a dictionary whose
keys describe possible aspects of a schema and whose respective
values of "YES" or "NO" determine whether that
schema option is enabled for a particular invocation. The possible
option keys are:
CreateTablesKey
DropTablesKey
CreatePrimaryKeySupportKey
DropPrimaryKeySupportKey
PrimaryKeyConstraintsKey
ForeignKeyConstraintsKey
CreateDatabaseKey
DropDatabaseKey
Used in conjunction with appendExpressionToScript
and schemaCreationStatementsForEntities
to build up the
SQL script to generate the specified schema for
allEntities
.
allEntities
- An array of EOEntity objects.options
- A dictionary describing the schema options
for which to generate SQL statements.
allEntities
with the given
options
.appendExpressionToScript(
EOSQLExpression anSQLExpression,
StringBuffer script)
,
schemaCreationStatementsForEntities(
NSArray allEntities, NSDictionary options)
,
EOSynchronizationFactory.schemaCreationScriptForEntities(
NSArray allEntities, NSDictionary options)
public NSArray schemaCreationStatementsForEntities(NSArray allEntities, NSDictionary options)
options
for the EOEntity objects in
allEntities
. Returns an empty array if either
allEntities
or options
is
null
or empty.
options
is a dictionary whose
keys possible aspects of a schema and whose respective values
of "YES" or "NO" determine whether that
schema option is enabled for a particular invocation. The possible
option keys are:
CreateTablesKey
DropTablesKey
CreatePrimaryKeySupportKey
DropPrimaryKeySupportKey
PrimaryKeyConstraintsKey
ForeignKeyConstraintsKey
CreateDatabaseKey
DropDatabaseKey
Used in conjunction with appendExpressionToScript
and schemaCreationScriptForEntities
to build up the
SQL script to generate the specified schema for
allEntities
.
allEntities
- An array of EOEntity objects.options
- A dictionary describing the schema options
for which to generate SQL statements.
allEntities
with the given
options
.schemaCreationScriptForEntities(
NSArray allEntities, NSDictionary options)
,
appendExpressionToScript(
EOSQLExpression expression, StringBuffer script)
,
EOSynchronizationFactory.schemaCreationStatementsForEntities(NSArray allEntities, NSDictionary options)
|
Last updated Thu Oct 21 15:04:16 PDT 2004. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |