WebObjects 5.4.1

com.webobjects.eoaccess.synchronization
Class EOSchemaSynchronizationFactory

java.lang.Object
  extended by com.webobjects.eoaccess.synchronization.EOSchemaSynchronizationFactory
All Implemented Interfaces:
EOSchemaGeneration, EOSchemaSynchronization
Direct Known Subclasses:
DerbyPlugIn.DerbySynchronizationFactory, EOSynchronizationFactory, FrontbasePlugIn.FrontbaseSynchronizationFactory, MicrosoftPlugIn.MicrosoftSynchronizationFactory, MySQLPlugIn.MySQLSynchronizationFactory, OpenBasePlugIn.OpenBaseSynchronizationFactory, OraclePlugIn.OracleSynchronizationFactory, SybasePlugIn.SybaseSynchronizationFactory

public class EOSchemaSynchronizationFactory
extends Object
implements EOSchemaGeneration, EOSchemaSynchronization

This class has been introduced to implement the interfaces EOSchemaGeneration and EOSchemaSynchronization, which were introduced in WebObjects 5.0. The API is essentially the same as in WebObjects 4.5.x except that methods that were formerly static methods of EOSQLExpression are now are instance methods of EOSchemaGeneration or EOSchemaSynchronization.

Since:
5.4
See Also:
EOSchemaGeneration, EOSchemaSynchronization

Nested Class Summary
static interface EOSchemaSynchronizationFactory.Delegate
          The Delegate interface for EOSynchronizationFactory is restricted to use by the EOModeler application and should not be implemented by others.
 
Nested classes/interfaces inherited from interface com.webobjects.eoaccess.synchronization.EOSchemaSynchronization
EOSchemaSynchronization.ColumnTypes
 
Constructor Summary
EOSchemaSynchronizationFactory(EOAdaptor adaptor)
          Creates and returns a new EOSynchronization factory that uses the specified adaptor to communicate with an external database.
 
Method Summary
 EOAdaptor adaptor()
          Returns the receiver's EOAdaptor.
 void appendExpressionToScript(EOSQLExpression expression, StringBuffer script)
          Appends expression's statement to script along with any necessary delimiter.
 EOAttribute attributeInEntityWithColumnName(EOEntity entity, String columnName)
           
 EOSchemaColumnDescription columnDescriptionForTableAndModel(String columnName, String tableName, EOModel eomodel)
          Return a Column Description object that describe the database schema.
 NSArray<EOSQLExpression> createDatabaseStatementsForConnectionDictionary(NSDictionary<String,Object> connectionDictionary, NSDictionary<String,Object> administrativeConnectionDictionary)
          The default implementation returns null.
protected  NSArray<EOSQLExpression> createIndexExpressionsForEntity(EOEntity entity, EOEntityIndex anIndex, EOEntity masterEntity)
           
protected  String createIndexStatementForEntity(EOEntity entity, String indexName, String tableName, NSArray<EOAttribute> attributeList)
           
 NSArray<EOSQLExpression> createIndexStatementsForEntityGroup(NSArray<EOEntity> entityGroup)
           
 NSArray<EOSQLExpression> createIndexStatementsForEntityGroups(NSArray<NSArray<EOEntity>> entityGroups)
           
 NSArray<EOSQLExpression> createTableStatementsForEntityGroup(NSArray<EOEntity> entityGroup)
          Returns an array of EOSQLExpression objects that define the SQL necessary to create a table for entityGroup.
 NSArray<EOSQLExpression> createTableStatementsForEntityGroups(NSArray<NSArray<EOEntity>> 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<EOSQLExpression> dropDatabaseStatementsForConnectionDictionary(NSDictionary<String,Object> connectionDictionary, NSDictionary<String,Object> administrativeConnectionDictionary)
          The default implementation returns null.
protected  NSArray<EOSQLExpression> dropIndexExpressionsForEntity(EOEntity entity, EOEntityIndex anIndex, EOEntity masterEntity)
           
protected  String dropIndexStatementForEntity(EOEntity entity, String indexName, String tableName)
           
 NSArray<EOSQLExpression> dropIndexStatementsForEntityGroup(NSArray<EOEntity> entityGroup)
           
 NSArray<EOSQLExpression> dropIndexStatementsForEntityGroups(NSArray<NSArray<EOEntity>> entityGroups)
           
 NSArray<EOSQLExpression> dropPrimaryKeySupportStatementsForEntityGroup(NSArray<EOEntity> entityGroup)
          The default implementation returns null.
 NSArray<EOSQLExpression> dropPrimaryKeySupportStatementsForEntityGroups(NSArray<NSArray<EOEntity>> 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<EOSQLExpression> dropTableStatementsForEntityGroup(NSArray<EOEntity> entityGroup)
          Returns an array of EOSQLExpression objects that define the SQL necessary to drop the table identified by entityGroup.
 NSArray<EOSQLExpression> dropTableStatementsForEntityGroups(NSArray<NSArray<EOEntity>> entityGroups)
          Returns an array of EOSQLExpression objects that define the SQL necessary to drop the tables for all the entity groups in entityGroups.
 NSArray<EOSQLExpression> foreignKeyConstraintStatementsForRelationship(EORelationship relationship)
          Returns an array of EOSQLExpression objects that define the SQL statements necessary to create foreign key constraints for relationship.
protected  String formatColumnName(String name)
          Formats the column name for insertion in a select statement.
protected  String formatTableName(String name)
          Formats the table name for insertion in a select statement.
protected  NSArray<EOEntityIndex> indexDefinitionForEntity(EOEntity entity)
           
 EOSchemaIndexDescription indexDescriptionForTableAndModel(String indexName, String tableName, EOModel eomodel)
          Return an Index Description object that describe the database schema.
 boolean isCaseSensitive()
          The default implementation returns false.
 boolean isColumnTypeEquivalentToColumnType(EOSchemaSynchronization.ColumnTypes candidate, EOSchemaSynchronization.ColumnTypes columnType, EOSchemaGenerationOptions options)
          Returns true if the name, precision, width, and scale of candidate are identical to the name, precision, width, and scale of columnType, false otherwise.
 NSArray<String> logicalErrorsInChangeDictionaryForModelOptions(EOSchemaSynchronizationModelChanges changes, EOModel model, EOSchemaGenerationOptions options)
          Steps through the change dictionary changes and returns an array of strings identifying all the columns and their tables where the allows NULL rule has been changed in the corresponding model to disallow NULL values, but the database still contains such values.
 EOSchemaSynchronizationModelChanges newChanges()
          Creates a new Changes object, to facilitate subclassing.
 EOSchemaGenerationOptions newOptions()
          Creates a new Options object, to facilitate subclassing.
 EOSchemaSynchronizationColumnChanges objectStoreChangesFromAttributeToAttribute(EOAttribute schemaAttribute, EOAttribute modelAttribute)
          Compares schemaAttribute with modelAttribute and returns a change dictionary of state that is different between the the two.
 String phraseCastingColumnNamed(String columnName, EOSchemaSynchronization.ColumnTypes type, EOSchemaSynchronization.ColumnTypes castType, EOSchemaGenerationOptions options)
          The default implementation returns columnName.
 NSArray<EOSQLExpression> primaryKeyConstraintStatementsForEntityGroup(NSArray<EOEntity> entityGroup)
          Returns an array of EOSQLExpression objects that define the SQL necessary to create the primary key constraints for entityGroup.
 NSArray<EOSQLExpression> primaryKeyConstraintStatementsForEntityGroups(NSArray<NSArray<EOEntity>> 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<NSArray<EOEntity>> primaryKeyEntityGroupsForEntities(NSArray<EOEntity> entities)
          Returns an array of primary key entity groups for entities, or an empty array if entities is empty or null.
 NSArray<EOSQLExpression> primaryKeySupportStatementsForEntityGroup(NSArray<EOEntity> entityGroup)
          The default implementation returns null.
 NSArray<EOSQLExpression> primaryKeySupportStatementsForEntityGroups(NSArray<NSArray<EOEntity>> 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<EOEntity> allEntities, EOSchemaGenerationOptions options)
          Returns a script of SQL statements suitable to create the schema based on options for the EOEntity objects in allEntities.
 NSArray<EOSQLExpression> schemaCreationStatementsForEntities(NSArray<EOEntity> 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()
           
 EOSchemaSynchronizationFactory.Delegate schemaSynchronizationDelegate()
          Returns the receiver's delegate.
 void setSchemaGenerationDelegate(EOSchemaGeneration.Delegate delegate)
           
 void setSchemaSynchronizationDelegate(EOSchemaSynchronizationFactory.Delegate delegate)
          Sets the receiver's delegate to delegate.
 NSArray<EOSQLExpression> statementsToConvertColumnType(String columnName, String tableName, EOSchemaSynchronization.ColumnTypes type, EOSchemaSynchronization.ColumnTypes newType, EOSchemaGenerationOptions options)
          The default implementation returns null.
 NSArray<EOSQLExpression> statementsToCopyTableNamed(String tempTableName, NSArray<EOEntity> entityGroup, EOSchemaSynchronizationTableChanges changes, EOSchemaGenerationOptions options)
          Returns an array of EOSQLExpressions to copy the specified table into a new table, whose definition is provided by entityGroup, an array of EOEntity objects with the same external name.
 NSArray<EOSQLExpression> statementsToDeleteColumnNamed(String columnName, String tableName, EOSchemaGenerationOptions options)
          The default implementation returns null.
 NSArray<EOSQLExpression> statementsToDropForeignKeyConstraintsOnEntityGroup(NSArray<EOEntity> entityGroup, EOSchemaSynchronizationTableChanges changes, EOSchemaGenerationOptions options)
           
 NSArray<EOSQLExpression> statementsToDropForeignKeyConstraintsOnEntityGroups(NSArray<NSArray<EOEntity>> entityGroups, EOSchemaSynchronizationModelChanges changes, EOSchemaGenerationOptions options)
          Returns an array of EOSQLExpressions to drop foreign key constraints for the table corresponding to entityGroups, which is an array containing arrays of EOEntity objects with the same external name.
 NSArray<EOSQLExpression> statementsToDropPrimaryKeyConstraintsOnEntityGroups(NSArray<NSArray<EOEntity>> entityGroups, EOSchemaSynchronizationModelChanges changes, EOSchemaGenerationOptions options)
          Returns an array of EOSQLExpressions to drop primary key constraints for the table corresponding to entityGroups, which is an array containing arrays of EOEntity objects with the same external name.
 NSArray<EOSQLExpression> statementsToDropPrimaryKeySupportForEntityGroups(NSArray<NSArray<EOEntity>> entityGroups, EOSchemaSynchronizationModelChanges changes, EOSchemaGenerationOptions options)
          Returns an array of EOSQLExpressions to drop primary key support for the table corresponding to entityGroups, which is an array containing arrays of EOEntity objects with the same external name.
 NSArray<EOSQLExpression> statementsToImplementForeignKeyConstraintsOnEntityGroups(NSArray<NSArray<EOEntity>> entityGroups, EOSchemaSynchronizationModelChanges changes, EOSchemaGenerationOptions options)
          Returns an array of EOSQLExpressions to implement foreign key constraints for the table corresponding to entityGroups, which is an array containing arrays of EOEntity objects with the same external name.
 NSArray<EOSQLExpression> statementsToImplementPrimaryKeyConstraintsOnEntityGroups(NSArray<NSArray<EOEntity>> entityGroups, EOSchemaSynchronizationModelChanges changes, EOSchemaGenerationOptions options)
          Returns an array of EOSQLExpressions to implement primary key constraints for the table corresponding to entityGroups, which is an array containing arrays of EOEntity objects with the same external name.
 NSArray<EOSQLExpression> statementsToImplementPrimaryKeySupportForEntityGroups(NSArray<NSArray<EOEntity>> entityGroups, EOSchemaSynchronizationModelChanges changes, EOSchemaGenerationOptions options)
          Returns an array of EOSQLExpressions to implement primary key support for the table corresponding to entityGroups, which is an array containing arrays of EOEntity objects with the same external name.
 NSArray<EOSQLExpression> statementsToInsertColumnForAttribute(EOAttribute attribute, EOSchemaGenerationOptions options)
          Returns an array of EOSQLExpressions to insert a column in the database schema for the specified attribute.
 NSArray<EOSQLExpression> statementsToModifyColumnNullRule(String columnName, String tableName, boolean allowsNull, EOSchemaGenerationOptions options)
          Returns null by default.
 NSArray<EOSQLExpression> statementsToRenameColumnNamed(String columnName, String tableName, String newName, EOSchemaGenerationOptions options)
          The default implementation returns null.
 NSArray<EOSQLExpression> statementsToRenameTableNamed(String oldTableName, String newTableName, EOSchemaGenerationOptions options)
          Returns an array of EOSQLExpressions to rename in place the the table indentifed by tableName to newName.
 NSArray<EOSQLExpression> statementsToUpdateObjectStoreForEntityGroups(NSArray<NSArray<EOEntity>> entityGroups, EOSchemaSynchronizationModelChanges changes, EOSchemaGenerationOptions options)
          Returns an array of EOSQLExpressions to update the database table that corresponds to entityGroups according to the changes and SQL generation instructions in the changes and options dictionaries.
 NSArray<EOSQLExpression> statementsToUpdateObjectStoreForModel(EOModel model, EOSchemaSynchronizationModelChanges changes, EOSchemaGenerationOptions options)
          Returns an array of EOSQLExpressions to synchronize the database with the EOModel model.
 boolean supportsDirectColumnCoercion()
          The default implementation returns false.
 boolean supportsDirectColumnDeletion()
          The default implementation returns false.
 boolean supportsDirectColumnInsertion()
          The default implementation returns false.
 boolean supportsDirectColumnNullRuleModification()
          The default implementation returns false.
 boolean supportsDirectColumnRenaming()
          The default implementation returns false.
 boolean supportsSchemaSynchronization()
          The default implementation returns false.
 boolean supportsTableDescriptionIntrospection()
          The default implementation returns false.
 EOSchemaTableDescription tableDescriptionForModel(String tableName, EOModel eomodel)
          Return a Table Description object that describe the database schema.
 NSArray<NSArray<EOEntity>> tableEntityGroupsForEntities(NSArray entities)
          Returns an array of table entity groups for entities, or an empty array if entities is empty or null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EOSchemaSynchronizationFactory

public EOSchemaSynchronizationFactory(EOAdaptor adaptor)
Creates and returns a new EOSynchronization factory that uses the specified adaptor to communicate with an external database.

Parameters:
adaptor - An EOAdaptor to associate with the new EOSynchronizationFactory.
Method Detail

setSchemaGenerationDelegate

public void setSchemaGenerationDelegate(EOSchemaGeneration.Delegate delegate)
Specified by:
setSchemaGenerationDelegate in interface EOSchemaGeneration

schemaGenerationDelegate

public EOSchemaGeneration.Delegate schemaGenerationDelegate()
Specified by:
schemaGenerationDelegate in interface EOSchemaGeneration
Returns:

adaptor

public EOAdaptor adaptor()
Returns the receiver's EOAdaptor.

Returns:
The receiver's EOAdaptor.

newOptions

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

Specified by:
newOptions in interface EOSchemaGeneration
Specified by:
newOptions in interface EOSchemaSynchronization
Returns:
Options object

newChanges

public EOSchemaSynchronizationModelChanges newChanges()
Creates a new Changes object, to facilitate subclassing.

Specified by:
newChanges in interface EOSchemaSynchronization
Returns:
Changes object

formatTableName

protected String formatTableName(String name)
Formats the table name for insertion in a select statement. The default is enclosing it in double quotes.

Parameters:
name - table name
Returns:
formated name

formatColumnName

protected String formatColumnName(String name)
Formats the column name for insertion in a select statement. The default is enclosing it in double quotes.

Parameters:
name - column name
Returns:
formated name

foreignKeyConstraintStatementsForRelationship

public NSArray<EOSQLExpression> foreignKeyConstraintStatementsForRelationship(EORelationship relationship)
Description copied from interface: EOSchemaGeneration
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

Specified by:
foreignKeyConstraintStatementsForRelationship in interface EOSchemaGeneration
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

public NSArray<EOSQLExpression> createTableStatementsForEntityGroup(NSArray<EOEntity> 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.

EOSynchronizationFactory's implementation does the following:

The following is an example of a CREATE TABLE statement produced by this method:

 
                         create table EMPLOYEE (
                           EMP_ID      int not null,
                           DEPT_ID     int null,
                           LAST_NAME   varchar(40) not null,
                           PHONE       char(12) null,
                           HIRE_DATE   date null,
                           SALARY      number(7, 2) null
                         )
 
 

If a database server's table creation semantics are different, a subclass should override this method or one or more of the following methods as appropriate:

Specified by:
createTableStatementsForEntityGroup in interface EOSchemaGeneration
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:
dropTableStatementsForEntityGroup(NSArray entityGroup), dropTableStatementsForEntityGroup(NSArray entityGroup), EOSQLExpression#addCreateClauseForAttribute( EOAttribute anEOAttribute), EOSQLExpression#columnTypeStringForAttribute( EOAttribute anEOAttribute), (boolean aBoolean), EOEntity#externalName()

dropTableStatementsForEntityGroup

public NSArray<EOSQLExpression> dropTableStatementsForEntityGroup(NSArray<EOEntity> 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.

This method creates a statement of the form:

             
                        DROP TABLE TABLE_NAME
 
 

where TABLE_NAME is the external name of the first entity in entityGroup.

If the database server's drop semantics are different, a subclass should override this method.

Specified by:
dropTableStatementsForEntityGroup in interface EOSchemaGeneration
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:
createTableStatementsForEntityGroup( NSArray entityGroup), EOEntity#externalName()

primaryKeyConstraintStatementsForEntityGroup

public NSArray<EOSQLExpression> primaryKeyConstraintStatementsForEntityGroup(NSArray<EOEntity> 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.

This method creates a statement of the form:

     
                        ALTER TABLE TABLE_NAME ADD PRIMARY KEY
                             (PRIMARY_KEY_COLUMN_NAMES)
 

where TABLE_NAME is the external name for the first entity in entityGroup and PRIMARY_KEY_COLUMN_NAMES is a comma-separated list of the column names of the first entity's primary key attributes. If the subclass's database server's primary key constraint semantics are different, the subclass should override this method.

Specified by:
primaryKeyConstraintStatementsForEntityGroup in interface EOSchemaGeneration
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()

primaryKeySupportStatementsForEntityGroup

public NSArray<EOSQLExpression> primaryKeySupportStatementsForEntityGroup(NSArray<EOEntity> entityGroup)
The default implementation returns null. Can be overridden by subclasses to return an array of EOSQLExpression objects that define the SQL necessary to create the primary key generation support for entityGroup.

Specified by:
primaryKeySupportStatementsForEntityGroup in interface EOSchemaGeneration
Parameters:
entityGroup - An array of EOEntity objects that have the same external name.
Returns:
null by default.
See Also:
dropPrimaryKeySupportStatementsForEntityGroup( NSArray entityGroup), EOAdaptorChannel#primaryKeyForNewRowWithEntity( EOEntity entity), EOEntity#externalName()

dropPrimaryKeySupportStatementsForEntityGroup

public NSArray<EOSQLExpression> dropPrimaryKeySupportStatementsForEntityGroup(NSArray<EOEntity> entityGroup)
The default implementation returns null. Can be overridden by subclasses to return an array of EOSQLExpression objects that define the SQL necessary to drop the primary key generation support for entityGroup.

Specified by:
dropPrimaryKeySupportStatementsForEntityGroup in interface EOSchemaGeneration
Parameters:
entityGroup - An array of EOEntity objects that have the same external name.
Returns:
null by default.
See Also:
primaryKeySupportStatementsForEntityGroup( NSArray entityGroup), EOEntity#externalName()

createTableStatementsForEntityGroups

public NSArray<EOSQLExpression> createTableStatementsForEntityGroups(NSArray<NSArray<EOEntity>> 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 empty.

This method invokes createTableStatementsForEntityGroup for each entity group in entityGroups and returns an array of all the resulting EOSQLExpressions.

Specified by:
createTableStatementsForEntityGroups in interface EOSchemaGeneration
Parameters:
entityGroups - An NSArray 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.
See Also:
createTableStatementsForEntityGroup( NSArray entityGroup), #schemaCreationStatementsForEntities( NSArray allEntities, NSDictionary options), EOEntity#externalName

dropTableStatementsForEntityGroups

public NSArray<EOSQLExpression> dropTableStatementsForEntityGroups(NSArray<NSArray<EOEntity>> 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 empty.

This method invokes dropTableStatementsForEntityGroup for each entity group in entityGroups and returns an array of all the resulting EOSQLExpressions.

Specified by:
dropTableStatementsForEntityGroups in interface EOSchemaGeneration
Parameters:
entityGroups - An NSArray 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:
dropTableStatementsForEntityGroup( NSArray entityGroup), #schemaCreationStatementsForEntities( NSArray allEntities, NSDictionary options), EOEntity#externalName()

primaryKeyConstraintStatementsForEntityGroups

public NSArray<EOSQLExpression> primaryKeyConstraintStatementsForEntityGroups(NSArray<NSArray<EOEntity>> 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.

This method invokes EOSQLExpression's implementation of primaryKeyConstraintStatementsForEntityGroup for each entity group in entityGroups and returns an array of all the resulting EOSQLExpressions.

Specified by:
primaryKeyConstraintStatementsForEntityGroups in interface EOSchemaGeneration
Parameters:
entityGroups - An NSArray 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:
primaryKeyConstraintStatementsForEntityGroup( NSArray entityGroup), EOEntity#externalName()

primaryKeySupportStatementsForEntityGroups

public NSArray<EOSQLExpression> primaryKeySupportStatementsForEntityGroups(NSArray<NSArray<EOEntity>> 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. If primary key generation is not supported, returns an array that contains the string "The 'Create Primary Key Support' option is unavailable."

This method invokes primaryKeySupportStatementsForEntityGroup for each entity group in entityGroups and returns an array of all the resulting EOSQLExpressions. Since the default implementation of primaryKeySupportStatementsForEntityGroup returns null, this method returns the "not supported" value (see above) by default, but a subclass need only override primaryKeySupportStatementsForEntityGroup in order to enable this method as well.

Specified by:
primaryKeySupportStatementsForEntityGroups in interface EOSchemaGeneration
Parameters:
entityGroups - An NSArray 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 a string message that the option is not supported.
See Also:
primaryKeySupportStatementsForEntityGroup( NSArray entityGroup), EOAdaptorChannel#primaryKeyForNewRowWithEntity( EOEntity entity), EOEntity#externalName()

dropPrimaryKeySupportStatementsForEntityGroups

public NSArray<EOSQLExpression> dropPrimaryKeySupportStatementsForEntityGroups(NSArray<NSArray<EOEntity>> 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. If primary key generation is not supported, returns an array that contains the string "The 'Drop Primary Key Support' option is unavailable."

This method invokes dropPrimaryKeySupportStatementsForEntityGroup for each entity group in entityGroups and returns an array of all the resulting EOSQLExpressions. Since the default implementation of dropPrimaryKeySupportStatementsForEntityGroup returns null, this method returns the "not supported" value (see above) by default, but a subclass need only override dropPrimaryKeySupportStatementsForEntityGroup in order to enable this method as well.

Specified by:
dropPrimaryKeySupportStatementsForEntityGroups in interface EOSchemaGeneration
Parameters:
entityGroups - An NSArray 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 a string message that the option is not supported.
See Also:
dropPrimaryKeySupportStatementsForEntityGroup( NSArray entityGroup), #schemaCreationStatementsForEntities( NSArray allEntities, NSDictionary options), EOAdaptorChannel#primaryKeyForNewRowWithEntity( EOEntity entity), EOEntity#externalName()

appendExpressionToScript

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

This method appends the SQL statement for expression to script followed by a semicolon and a newline. A subclass of EOSQLExpression only need to override this method if the delimiter for its database server is different.

Specified by:
appendExpressionToScript in interface EOSchemaGeneration
Parameters:
expression - An EOSQLExpression.
script - A StringBuffer used to build the SQL script.
See Also:
createTableStatementsForEnti