WebObjects 5.4.2

com.webobjects.eoaccess.synchronization
Interface EOSchemaGeneration

All Known Subinterfaces:
EOSchemaGeneration
All Known Implementing Classes:
DerbyPlugIn.DerbySynchronizationFactory, EOSchemaSynchronizationFactory, EOSynchronizationFactory, FrontbasePlugIn.FrontbaseSynchronizationFactory, MerantPlugIn.MerantSynchronizationFactory, MicrosoftPlugIn.MicrosoftSynchronizationFactory, MySQLPlugIn.MySQLSynchronizationFactory, OpenBasePlugIn.OpenBaseSynchronizationFactory, OraclePlugIn.OracleSynchronizationFactory, SybasePlugIn.SybaseSynchronizationFactory

public interface EOSchemaGeneration

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

Since:
5.4
See Also:
EOSQLExpression, EOSchemaSynchronizationFactory

Nested Class Summary
static interface EOSchemaGeneration.Delegate
           
 
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 createIndexStatementsForEntityGroup(NSArray entityGroup)
           
 NSArray createIndexStatementsForEntityGroups(NSArray entityGroups)
           
 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 dropIndexStatementsForEntityGroup(NSArray entityGroup)
           
 NSArray dropIndexStatementsForEntityGroups(NSArray entityGroups)
           
 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.
 EOSchemaGenerationOptions newOptions()
          Creates a new Options object, to facilitate subclassing.
 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, EOSchemaGenerationOptions 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, EOSchemaGenerationOptions options)
          Returns an array of EOSQLExpressions suitable to create the schema based on options for the EOEntity objects in allEntities.
 EOSchemaGeneration.Delegate schemaGenerationDelegate()
           
 void setSchemaGenerationDelegate(EOSchemaGeneration.Delegate delegate)
           
 

Method Detail

setSchemaGenerationDelegate

void setSchemaGenerationDelegate(EOSchemaGeneration.Delegate delegate)
Parameters:
delegate -

schemaGenerationDelegate

EOSchemaGeneration.Delegate schemaGenerationDelegate()
Returns:

newOptions

EOSchemaGenerationOptions newOptions()
Creates a new Options object, to facilitate subclassing.

Returns:
Options object

foreignKeyConstraintStatementsForRelationship

NSArray foreignKeyConstraintStatementsForRelationship(EORelationship relationship)
Returns an array of EOSQLExpression objects that define the SQL statements necessary to create foreign key constraints for relationship. Returns an empty array if unable to generate foreign key constraints for relationship

Parameters:
relationship - An EORelationship.
Returns:
An array of EOSQLExpressions to create the foreign key constraints for relationship, or an empty array.
See Also:
EOSQLExpression, EOSchemaSynchronizationFactory.foreignKeyConstraintStatementsForRelationship(EORelationship relationship), #schemaCreationStatementsForEntities( NSArray allEntities, NSDictionary options)

createTableStatementsForEntityGroup

NSArray createTableStatementsForEntityGroup(NSArray entityGroup)
Returns an array of EOSQLExpression objects that define the SQL necessary to create a table for entityGroup. Returns an empty array if entityGroup is null or empty.

Parameters:
entityGroup - An array of EOEntity objects that have the same external name.
Returns:
An array of EOSQLExpressions that define the SQL necessary to create tables for the entities in entityGroup, or an empty array.
See Also:
EOSchemaGeneration.createTableStatementsForEntityGroups( NSArray entityGroup), EOSchemaGeneration.dropTableStatementsForEntityGroup( NSArray entityGroup), EOEntity.externalName(), EOSchemaSynchronizationFactory.createTableStatementsForEntityGroup( NSArray entityGroup)

dropTableStatementsForEntityGroup

NSArray dropTableStatementsForEntityGroup(NSArray entityGroup)
Returns an array of EOSQLExpression objects that define the SQL necessary to drop the table identified by 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.

Parameters:
entityGroup - An array of EOEntity objects that have the same external name.
Returns:
An array of EOSQLExpressions that define the SQL necessary to drop tables for the entities in entityGroup, or an empty array.
See Also:
EOSchemaGeneration.createTableStatementsForEntityGroup(NSArray entityGroup), EOSchemaGeneration.dropTableStatementsForEntityGroups(NSArray entityGroups), EOEntity.externalName(), EOSchemaSynchronizationFactory.dropTableStatementsForEntityGroup( NSArray entityGroup)

primaryKeyConstraintStatementsForEntityGroup

NSArray primaryKeyConstraintStatementsForEntityGroup(NSArray entityGroup)
Returns an array of EOSQLExpression objects that define the SQL necessary to create the primary key constraints for 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.

Parameters:
entityGroup - An array of EOEntity objects that have the same external name.
Returns:
An array of EOSQLExpressions that define the SQL necessary to create primary key constraints for entityGroup, or an empty array.
See Also:
EOAttribute.columnName(), EOEntity.externalName(), EOEntity.primaryKeyAttributes(), EOSchemaSynchronizationFactory.primaryKeyConstraintStatementsForEntityGroup( NSArray entityGroup)

primaryKeySupportStatementsForEntityGroup

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.

Parameters:
entityGroup - An array of EOEntity objects that have the same external name.
Returns:
An array of EOSQLExpressions that define the SQL necessary to create primary key generation support for entityGroup, or null>.
See Also:
EOSchemaGeneration.dropPrimaryKeySupportStatementsForEntityGroup( NSArray entityGroup), EOAdaptorChannel.primaryKeyForNewRowWithEntity( EOEntity entity), EOEntity.externalName(), EOSchemaSynchronizationFactory.primaryKeySupportStatementsForEntityGroup( NSArray entityGroup)

dropPrimaryKeySupportStatementsForEntityGroup

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.

Parameters:
entityGroup - An array of EOEntity objects that have the same external name.
Returns:
An array of EOSQLExpressions that define the SQL necessary to drop primary key generation support for entityGroup, or null.
See Also:
EOSchemaGeneration.primaryKeySupportStatementsForEntityGroup( NSArray entityGroup), EOEntity.externalName(), EOSchemaSynchronizationFactory.dropPrimaryKeySupportStatementsForEntityGroup( NSArray entityGroup)

createTableStatementsForEntityGroups

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. Returns an empty array if entityGroups is null or empty.

Parameters:
entityGroups - An array of entity groups, which are arrays of EOEntity objects that have the same external name.
Returns:
An array of EOSQLExpressions that define the SQL necessary to create tables for the entity groups in entityGroups, or an empty array.
See Also:
EOSchemaGeneration.createTableStatementsForEntityGroup( NSArray entityGroup), #schemaCreationStatementsForEntities( NSArray allEntities, NSDictionary options), EOEntity.externalName(), EOSchemaSynchronizationFactory.createTableStatementsForEntityGroups( NSArray entityGroups)

dropTableStatementsForEntityGroups

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. Returns an empty array if entityGroups is null or empty.

Parameters:
entityGroups - An array of entity groups, which are arrays of EOEntity objects that have the same external name.
Returns:
An array of EOSQLExpressions that define the SQL necessary to drop tables for the entity groups in entityGroups, or an empty array.
See Also:
EOSchemaGeneration.dropTableStatementsForEntityGroup( NSArray entityGroup), #schemaCreationStatementsForEntities( NSArray allEntities, NSDictionary options), EOEntity.externalName(), EOSchemaSynchronizationFactory.dropTableStatementsForEntityGroups( NSArray entityGroups)

primaryKeyConstraintStatementsForEntityGroups

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. Returns an empty array if entityGroups is null or empty.

Parameters:
entityGroups - An array of entity groups, which are arrays of EOEntity objects that have the same external name.
Returns:
An array of EOSQLExpressions that define the SQL necessary to create primary key constraints for entityGroups, or an empty array.
See Also:
EOSchemaGeneration.primaryKeyConstraintStatementsForEntityGroup( NSArray entityGroup), EOEntity.externalName(), EOSchemaSynchronizationFactory.primaryKeyConstraintStatementsForEntityGroups( NSArray entityGroups)

primaryKeySupportStatementsForEntityGroups

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

Parameters:
entityGroups - An array of entity groups, which are arrays of EOEntity objects that have the same external name.
Returns:
An array of EOSQLExpressions that define the SQL necessary to create primary key generation support for entityGroups, or an empty array, or an array containing an error string.
See Also:
EOSchemaGeneration.primaryKeySupportStatementsForEntityGroup( NSArray entityGroup), EOAdaptorChannel.primaryKeyForNewRowWithEntity( EOEntity entity), EOEntity.externalName(), EOSchemaSynchronizationFactory.primaryKeySupportStatementsForEntityGroups( NSArray entityGroups)

dropPrimaryKeySupportStatementsForEntityGroups

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

Parameters:
entityGroups - An array of entity groups, which are arrays of EOEntity objects that have the same external name.
Returns:
An array of EOSQLExpressions that define the SQL necessary to drop primary key generation support for entityGroups, or an empty array, or an array containing an error string.
See Also:
EOSchemaGeneration.dropPrimaryKeySupportStatementsForEntityGroup( NSArray entityGroup), #schemaCreationStatementsForEntities( NSArray allEntities, NSDictionary options), EOAdaptorChannel.primaryKeyForNewRowWithEntity( EOEntity entity), EOEntity.externalName(), EOSchemaSynchronizationFactory.dropPrimaryKeySupportStatementsForEntityGroups( NSArray entityGroups)

schemaCreationScriptForEntities

String schemaCreationScriptForEntities(NSArray allEntities,
                                       EOSchemaGenerationOptions options)
Returns a script of SQL statements suitable to create the schema based on options for the EOEntity objects in allEntities. Returns an empty string if either options or allEntities is empty or null.

options is an option object used in conjunction with appendExpressionToScript and schemaCreationScriptForEntities to build up the SQL script to generate the specified schema for allEntities.

Parameters:
allEntities - An array of EOEntity objects.
options - A option object describing the schema options for which to generate SQL statements.
Returns:
A string comprising the SQL statements necessary to create a schema for allEntities with the given options.
See Also:
EOSchemaGeneration.appendExpressionToScript( EOSQLExpression anSQLExpression, StringBuffer script), EOSchemaGeneration.schemaCreationStatementsForEntities( NSArray allEntities, EOSchemaGenerationOptions options), EOSchemaSynchronizationFactory.schemaCreationScriptForEntities( NSArray allEntities, EOSchemaGenerationOptions options)

appendExpressionToScript

void appendExpressionToScript(EOSQLExpression expression,
                              StringBuffer script)
Appends 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.

Parameters:
expression - An EOSQLExpression.
script - A StringBuffer used to build the SQL script.
See Also:
EOSchemaGeneration.createTableStatementsForEntityGroup( NSArray entityGroup), EOSchemaSynchronizationFactory.appendExpressionToScript( EOSQLExpression expression, StringBuffer script), EOSQLExpression

schemaCreationStatementsForEntities

NSArray schemaCreationStatementsForEntities(NSArray allEntities,
                                            EOSchemaGenerationOptions options)
Returns an array of EOSQLExpressions suitable to create the schema based on options for the EOEntity objects in allEntities. Returns an empty array if either allEntities or options is null or empty.

options is an option object used in conjunction with appendExpressionToScript and schemaCreationScriptForEntities to build up the SQL script to generate the specified schema for allEntities.

Parameters:
allEntities - An array of EOEntity objects.
options - An option object describing the schema options for which to generate SQL statements.
Returns:
An array of EOSQLExpressions that define the SQL statements necessary to create a schema for allEntities with the given options.
See Also:
#schemaCreationScriptForEntities( NSArray allEntities, NSDictionary options), EOSchemaGeneration.appendExpressionToScript( EOSQLExpression expression, StringBuffer script), EOSchemaSynchronizationFactory.schemaCreationStatementsForEntities(NSArray allEntities, EOSchemaGenerationOptions options)

createDatabaseStatementsForConnectionDictionary

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. Returns null if this feature is not supported.

Parameters:
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.
Returns:
An array of the EOSQLExpressions needed to create a database for the given parameters.
See Also:
EOSchemaGeneration.dropDatabaseStatementsForConnectionDictionary( NSDictionary connectionDictionary, NSDictionary administrativeConnectionDictionary)

dropDatabaseStatementsForConnectionDictionary

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. Returns null if this feature is not supported.

Parameters:
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.
Returns:
An array of the EOSQLExpressions needed to drop a database for the given parameters.
See Also:
EOSchemaGeneration.createDatabaseStatementsForConnectionDictionary( NSDictionary connectionDictionary, NSDictionary administrativeConnectionDictionary)

createIndexStatementsForEntityGroups

NSArray createIndexStatementsForEntityGroups(NSArray entityGroups)
Parameters:
entityGroups -
Returns:

createIndexStatementsForEntityGroup

NSArray createIndexStatementsForEntityGroup(NSArray entityGroup)

dropIndexStatementsForEntityGroups

NSArray dropIndexStatementsForEntityGroups(NSArray entityGroups)
Parameters:
entityGroups -
Returns:

dropIndexStatementsForEntityGroup

NSArray dropIndexStatementsForEntityGroup(NSArray entityGroup)

Last updated June 2008

Copyright © 2000-2008 Apple Inc.