WebObjects 5.4.2

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 createDatabaseStatementsForConnectionDictionary(NSDictionary connectionDictionary, NSDictionary administrativeConnectionDictionary)
          The default implementation returns null.
protected  NSArray createIndexExpressionsForEntity(EOEntity entity, EOEntityIndex anIndex, EOEntity masterEntity)
           
protected  String createIndexStatementForEntity(EOEntity entity, String indexName, String tableName, NSArray attributeList)
           
 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)
          The default implementation returns null.
protected  NSArray dropIndexExpressionsForEntity(EOEntity entity, EOEntityIndex anIndex, EOEntity masterEntity)
           
protected  String dropIndexStatementForEntity(EOEntity entity, String indexName, String tableName)
           
 NSArray dropIndexStatementsForEntityGroup(NSArray entityGroup)
           
 NSArray dropIndexStatementsForEntityGroups(NSArray entityGroups)
           
 NSArray dropPrimaryKeySupportStatementsForEntityGroup(NSArray entityGroup)
          The default implementation returns null.
 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.
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 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 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 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 primaryKeyEntityGroupsForEntities(NSArray entities)
          Returns an array of primary key entity groups for entities, or an empty array if entities is empty or null.
 NSArray primaryKeySupportStatementsForEntityGroup(NSArray entityGroup)
          The default implementation returns null.
 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()
           
 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 statementsToConvertColumnType(String columnName, String tableName, EOSchemaSynchronization.ColumnTypes type, EOSchemaSynchronization.ColumnTypes newType, EOSchemaGenerationOptions options)
          The default implementation returns null.
 NSArray statementsToCopyTableNamed(String tempTableName, NSArray 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 statementsToDeleteColumnNamed(String columnName, String tableName, EOSchemaGenerationOptions options)
          The default implementation returns null.
 NSArray statementsToDropForeignKeyConstraintsOnEntityGroup(NSArray entityGroup, EOSchemaSynchronizationTableChanges changes, EOSchemaGenerationOptions options)
           
 NSArray statementsToDropForeignKeyConstraintsOnEntityGroups(NSArray 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 statementsToDropPrimaryKeyConstraintsOnEntityGroups(NSArray 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 statementsToDropPrimaryKeySupportForEntityGroups(NSArray 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 statementsToImplementForeignKeyConstraintsOnEntityGroups(NSArray 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 statementsToImplementPrimaryKeyConstraintsOnEntityGroups(NSArray 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 statementsToImplementPrimaryKeySupportForEntityGroups(NSArray 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 statementsToInsertColumnForAttribute(EOAttribute attribute, EOSchemaGenerationOptions options)
          Returns an array of EOSQLExpressions to insert a column in the database schema for the specified attribute.
 NSArray statementsToModifyColumnNullRule(String columnName, String tableName, boolean allowsNull, EOSchemaGenerationOptions options)
          Returns null by default.
 NSArray statementsToRenameColumnNamed(String columnName, String tableName, String newName, EOSchemaGenerationOptions options)
          The default implementation returns null.
 NSArray 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 statementsToUpdateObjectStoreForEntityGroups(NSArray 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 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 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 to return the table name without quotes. Override this in the plugin for custom behavior.

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 to return the column name without quotes. Override this in the plugin for custom behavior.

Parameters:
name - column name
Returns:
formated name

foreignKeyConstraintStatementsForRelationship

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

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:
EOSchemaSynchronizationFactory.dropTableStatementsForEntityGroup(NSArray entityGroup), EOSchemaSynchronizationFactory.dropTableStatementsForEntityGroup(NSArray entityGroup), EOSQLExpression.addCreateClauseForAttribute( EOAttribute anEOAttribute), EOSQLExpression.columnTypeStringForAttribute( EOAttribute anEOAttribute), (boolean aBoolean), EOEntity.externalName()

dropTableStatementsForEntityGroup

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

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:
EOSchemaSynchronizationFactory.createTableStatementsForEntityGroup( NSArray entityGroup), EOEntity.externalName()

primaryKeyConstraintStatementsForEntityGroup

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

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 primaryKeySupportStatementsForEntityGroup(NSArray 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:
EOSchemaSynchronizationFactory.dropPrimaryKeySupportStatementsForEntityGroup( NSArray entityGroup), EOAdaptorChannel.primaryKeyForNewRowWithEntity( EOEntity entity), EOEntity.externalName()

dropPrimaryKeySupportStatementsForEntityGroup

public NSArray dropPrimaryKeySupportStatementsForEntityGroup(NSArray 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:
EOSchemaSynchronizationFactory.primaryKeySupportStatementsForEntityGroup( NSArray entityGroup), EOEntity.externalName()

createTableStatementsForEntityGroups

public 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 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:
EOSchemaSynchronizationFactory.createTableStatementsForEntityGroup( NSArray entityGroup), #schemaCreationStatementsForEntities( NSArray allEntities, NSDictionary options), EOEntity.externalName()

dropTableStatementsForEntityGroups

public 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 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:
EOSchemaSynchronizationFactory.dropTableStatementsForEntityGroup( NSArray entityGroup), #schemaCreationStatementsForEntities( NSArray allEntities, NSDictionary options), EOEntity.externalName()

primaryKeyConstraintStatementsForEntityGroups

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

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:
EOSchemaSynchronizationFactory.primaryKeyConstraintStatementsForEntityGroup( NSArray entityGroup), EOEntity.externalName()

primaryKeySupportStatementsForEntityGroups

public 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. 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:
EOSchemaSynchronizationFactory.primaryKeySupportStatementsForEntityGroup( NSArray entityGroup), EOAdaptorChannel.primaryKeyForNewRowWithEntity( EOEntity entity), EOEntity.externalName()

dropPrimaryKeySupportStatementsForEntityGroups

public 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. 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:
EOSchemaSynchronizationFactory.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:
EOSchemaSynchronizationFactory.createTableStatementsForEntityGroup( NSArray entityGroup)

schemaCreationScriptForEntities

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

This method invokes schemaCreationStatementsForEntities with entities and options and then uses appendExpressionToScript to build up the script string from the EOSQLExpressions returned by schemaCreationStatementsForEntities.

Specified by:
schemaCreationScriptForEntities in interface EOSchemaGeneration
Parameters:
allEntities - An array of EOEntity objects.
options - A dictionary 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:
EOSchemaSynchronizationFactory.appendExpressionToScript( EOSQLExpression expression, StringBuffer script), #schemaCreationStatementsForEntities( NSArray allEntities, NSDictionary options)

tableEntityGroupsForEntities

public NSArray tableEntityGroupsForEntities(NSArray entities)
Returns an array of table entity groups for entities, or an empty array if entities is empty or null. Table entity groups are arrays of entities with attributes that have column names; within each group, the entities have the same external name.

Parameters:
entities - An array of EOEntities for which to obtain table entity groups.
Returns:
An array of table entity groups for entities.

primaryKeyEntityGroupsForEntities

public NSArray primaryKeyEntityGroupsForEntities(NSArray entities)
Returns an array of primary key entity groups for entities, or an empty array if entities is empty or null. Primary key entity groups are arrays of entities with simple primary keys; within each group, the entities have the same external name.

Parameters:
entities - An array of EOEntities for which to obtain primary key entity groups.
Returns:
An array of primary key entity groups for entities.
See Also:
EOEntity

schemaCreationStatementsForEntities

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



Used in conjunction with appendExpressionToScript and schemaCreationScriptForEntities to build up the SQL script to generate the specified schema for allEntities.

Specified by:
schemaCreationStatementsForEntities in interface EOSchemaGeneration
Parameters:
allEntities - An array of EOEntity objects.
options - A dictionary 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), EOSchemaSynchronizationFactory.appendExpressionToScript( EOSQLExpression expression, StringBuffer script)

createDatabaseStatementsForConnectionDictionary

public NSArray createDatabaseStatementsForConnectionDictionary(NSDictionary connectionDictionary,
                                                               NSDictionary administrativeConnectionDictionary)
The default implementation returns null. Can be overridden by subclasses to generate and return an array of EOSQLExpressions defining the SQL statements to create a database or user that can be accessed by the provided connectionDictionary and administrativeConnectionDictionary.

Specified by:
createDatabaseStatementsForConnectionDictionary in interface EOSchemaGeneration
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:
null by default.
See Also:
EOSchemaSynchronizationFactory.dropDatabaseStatementsForConnectionDictionary( NSDictionary connectionDictionary, NSDictionary administrativeConnectionDictionary)

dropDatabaseStatementsForConnectionDictionary

public NSArray dropDatabaseStatementsForConnectionDictionary(NSDictionary connectionDictionary,
                                                             NSDictionary administrativeConnectionDictionary)
The default implementation returns null. Can be overridden by subclasses to generate and return an array of EOSQLExpressions defining the SQL statements to drop a database or user that is accessed by the provided connectionDictionary and administrativeConnectionDictionary.

Specified by:
dropDatabaseStatementsForConnectionDictionary in interface EOSchemaGeneration
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:
null by default.
See Also:
EOSchemaSynchronizationFactory.createDatabaseStatementsForConnectionDictionary( NSDictionary connectionDictionary, NSDictionary administrativeConnectionDictionary)

attributeInEntityWithColumnName

public EOAttribute attributeInEntityWithColumnName(EOEntity entity,
                                                   String columnName)
Parameters:
entity -
columnName -
Returns:

isCaseSensitive

public boolean isCaseSensitive()
The default implementation returns false.

Returns:
false by default.

isColumnTypeEquivalentToColumnType

public 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. If the columns are equivalent, the candidate column can be copied to columnType without casting.

Specified by:
isColumnTypeEquivalentToColumnType in interface EOSchemaSynchronization
Parameters:
candidate - A column to potentially copy.
columnType - A column into which to copy candidate.
options - Unused.
Returns:
true if the specified attributes of candidate are identical to the corresponding attributes of columnType.

logicalErrorsInChangeDictionaryForModelOptions

public NSArray 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. Returns null if no logical errors are detected.

Parameters:
changes - A change dictionary for model with respect to a database.
model - An EOModel to synchronize with a database.
options - Unused.
Returns:
An array of strings describing logical errors in changes with respect to model.
See Also:
EOSchemaSynchronizationFactory.objectStoreChangesFromAttributeToAttribute( EOAttribute schemaAttribute, EOAttribute modelAttribute)

phraseCastingColumnNamed

public String phraseCastingColumnNamed(String columnName,
                                       EOSchemaSynchronization.ColumnTypes type,
                                       EOSchemaSynchronization.ColumnTypes castType,
                                       EOSchemaGenerationOptions options)
The default implementation returns columnName. Can be overridden by subclasses to return an SQL string to cast the values in the column identified by columnName from the current type to a new type specified by castType. options is a dictionary describing the aspects of the schema for which to create SQL statements.

Specified by:
phraseCastingColumnNamed in interface EOSchemaSynchronization
Parameters:
columnName - The name of a database column.
type - Unused.
castType - Unused.
options - Unused.
Returns:
columnType by default.
See Also:
EOAttribute.columnName()

setSchemaSynchronizationDelegate

public void setSchemaSynchronizationDelegate(EOSchemaSynchronizationFactory.Delegate delegate)
Sets the receiver's delegate to delegate.

Parameters:
delegate - The object to set as the receiver's delegate.

schemaSynchronizationDelegate

public EOSchemaSynchronizationFactory.Delegate schemaSynchronizationDelegate()
Returns the receiver's delegate.

Returns:
The object that acts as the receiver's delegate.

statementsToCopyTableNamed

public NSArray statementsToCopyTableNamed(String tempTableName,
                                          NSArray entityGroup,
                                          EOSchemaSynchronizationTableChanges changes,
                                          EOSchemaGenerationOptions options)
Description copied from interface: EOSchemaSynchronization
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. This method is used when the adaptor doesn't support the in-place table modifications required to synchronize the database to a model.

The changes dictionary identifies the changes to make to the database schema. The options dictionary describes the aspects of the schema for which to create SQL statements.

Specified by:
statementsToCopyTableNamed in interface EOSchemaSynchronization
Parameters:
tempTableName - The name of the table to be copied.
entityGroup - An array of EOEntity objects that defines a new database table into which to copy the named table.
changes - A dictionary of changes to make to the database schema.
options - A dictionary describing the aspects of the schema for which to create SQL statements.
Returns:
An array of the EOSQLExpressions to copy the table named tableName to a new table defined by entityGroup.
See Also:
EOSchemaSynchronization

statementsToConvertColumnType

public NSArray statementsToConvertColumnType(String columnName,
                                             String tableName,
                                             EOSchemaSynchronization.ColumnTypes type,
                                             EOSchemaSynchronization.ColumnTypes newType,
                                             EOSchemaGenerationOptions options)
The default implementation returns null. Can be overridden by subclasses to return an array of EOSQLExpressions to convert in place of the type of the column indentifed by columnName in the table identified by tableName from the current type to the type specified by newType. options is a dictionary describing the aspects of the schema for which to create SQL statements.

Specified by:
statementsToConvertColumnType in interface EOSchemaSynchronization
Parameters:
columnName - The name of a column to be modified.
tableName - The name of the table containing the specified column.
type - The current type of the specified column.
newType - The type to which to convert the specified column.
options - A dictionary describing the aspects of the schema for which to create SQL statements.
Returns:
empty array by default.

statementsToDeleteColumnNamed

public NSArray statementsToDeleteColumnNamed(String columnName,
                                             String tableName,
                                             EOSchemaGenerationOptions options)
The default implementation returns null. Can be overridden by subclasses to return an array of EOSQLExpressions to delete in place of the column indentifed by from the table identified by tableName. options is a dictionary describing the aspects of the schema for which to create SQL statements.

Specified by:
statementsToDeleteColumnNamed in interface EOSchemaSynchronization
Parameters:
columnName - The name of a column to be deleted.
tableName - The name of the table containing the specified column.
options - A dictionary describing the aspects of the schema for which to create SQL statements.
Returns:
empty array by default.

statementsToDropForeignKeyConstraintsOnEntityGroups

public NSArray statementsToDropForeignKeyConstraintsOnEntityGroups(NSArray entityGroups,
                                                                   EOSchemaSynchronizationModelChanges changes,
                                                                   EOSchemaGenerationOptions options)
Description copied from interface: EOSchemaSynchronization
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. The changes dictionary identifies the changes to make to the database schema. The options dictionary describes the aspects of the schema for which to create SQL statements.

Specified by:
statementsToDropForeignKeyConstraintsOnEntityGroups in interface EOSchemaSynchronization
Parameters:
entityGroups - An array containing arrays of EOEntity objects with the same external name.
changes - A dictionary of changes to make to the database schema.
options - A dictionary describing the aspects of the schema for which to create SQL statements.
Returns:
An array of the EOSQLExpressions to drop foreign key constraints for the table corresponding to entityGroups.
See Also:
EOSchemaSynchronization

statementsToDropForeignKeyConstraintsOnEntityGroup

public NSArray statementsToDropForeignKeyConstraintsOnEntityGroup(NSArray entityGroup,
                                                                  EOSchemaSynchronizationTableChanges changes,
                                                                  EOSchemaGenerationOptions options)

statementsToDropPrimaryKeyConstraintsOnEntityGroups

public NSArray statementsToDropPrimaryKeyConstraintsOnEntityGroups(NSArray entityGroups,
                                                                   EOSchemaSynchronizationModelChanges changes,
                                                                   EOSchemaGenerationOptions options)
Description copied from interface: EOSchemaSynchronization
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. The changes dictionary identifies the changes to make to the database schema. The options dictionary describes the aspects of the schema for which to create SQL statements.

Specified by:
statementsToDropPrimaryKeyConstraintsOnEntityGroups in interface EOSchemaSynchronization
Parameters:
entityGroups - An array containing arrays of EOEntity objects with the same external name.
changes - A dictionary of changes to make to the database schema.
options - A dictionary describing the aspects of the schema for which to create SQL statements.
Returns:
An array of the EOSQLExpressions to drop primary key constraints for the table corresponding to entityGroups.
See Also:
EOSchemaSynchronization

statementsToDropPrimaryKeySupportForEntityGroups

public NSArray statementsToDropPrimaryKeySupportForEntityGroups(NSArray entityGroups,
                                                                EOSchemaSynchronizationModelChanges changes,
                                                                EOSchemaGenerationOptions options)
Description copied from interface: EOSchemaSynchronization
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. The changes dictionary identifies the changes to make to the database schema. The options dictionary describes the aspects of the schema for which to create SQL statements.

Specified by:
statementsToDropPrimaryKeySupportForEntityGroups in interface EOSchemaSynchronization
Parameters:
entityGroups - An array containing arrays of EOEntity objects with the same external name.
changes - A dictionary of changes to make to the database schema.
options - A dictionary describing the aspects of the schema for which to create SQL statements.
Returns:
An array of the EOSQLExpressions to drop primary key support for the table corresponding to entityGroups.
See Also:
EOSchemaSynchronization

statementsToImplementForeignKeyConstraintsOnEntityGroups

public NSArray statementsToImplementForeignKeyConstraintsOnEntityGroups(NSArray entityGroups,
                                                                        EOSchemaSynchronizationModelChanges changes,
                                                                        EOSchemaGenerationOptions options)
Description copied from interface: EOSchemaSynchronization
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. The changes dictionary identifies changes to make to the database schema. The options dictionary describes the aspects of the schema for which to create SQL statements.

Specified by:
statementsToImplementForeignKeyConstraintsOnEntityGroups in interface EOSchemaSynchronization
Parameters:
entityGroups - An array containing arrays of EOEntity objects with the same external name.
changes - A dictionary of changes to make to the database schema.
options - A dictionary describing the aspects of the schema for which to create SQL statements.
Returns:
An array of the EOSQLExpressions to implement foreign key constraints for the table corresponding to entityGroups.
See Also:
EOSchemaSynchronization

statementsToImplementPrimaryKeyConstraintsOnEntityGroups

public NSArray statementsToImplementPrimaryKeyConstraintsOnEntityGroups(NSArray entityGroups,
                                                                        EOSchemaSynchronizationModelChanges changes,
                                                                        EOSchemaGenerationOptions options)
Description copied from interface: EOSchemaSynchronization
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. The changes dictionary identifies the changes to make to the database schema. The options dictionary describes the aspects of the schema for which to create SQL statements.

Specified by:
statementsToImplementPrimaryKeyConstraintsOnEntityGroups in interface EOSchemaSynchronization
Parameters:
entityGroups - An array containing arrays of EOEntity objects with the same external name.
changes - A dictionary of changes to make to the database schema.
options - A dictionary describing the aspects of the schema for which to create SQL statements.
Returns:
An array of the EOSQLExpressions to implement primary key constraints for the table corresponding to entityGroups.
See Also:
EOSchemaSynchronization

statementsToImplementPrimaryKeySupportForEntityGroups

public NSArray statementsToImplementPrimaryKeySupportForEntityGroups(NSArray entityGroups,
                                                                     EOSchemaSynchronizationModelChanges changes,
                                                                     EOSchemaGenerationOptions options)
Description copied from interface: EOSchemaSynchronization
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. The changes dictionary identifies the changes to make to the database schema. The options dictionary describes the aspects of the schema for which to create SQL statements.

Specified by:
statementsToImplementPrimaryKeySupportForEntityGroups in interface EOSchemaSynchronization
Parameters:
entityGroups -
changes -
options -
Returns:
See Also:
EOSchemaSynchronization

statementsToInsertColumnForAttribute

public NSArray statementsToInsertColumnForAttribute(EOAttribute attribute,
                                                    EOSchemaGenerationOptions options)
Description copied from interface: EOSchemaSynchronization
Returns an array of EOSQLExpressions to insert a column in the database schema for the specified attribute. The options dictionary describes the aspects of the schema for which to create SQL statements.

Specified by:
statementsToInsertColumnForAttribute in interface EOSchemaSynchronization
Parameters:
attribute - An EOAttribute for which to insert a database column.
options - A dictionary describing the aspects of the schema for which to create SQL statements.
Returns:
An array of the EOSQLExpressions to insert the column for attribute.
See Also:
EOAttribute, EOSchemaSynchronization

statementsToModifyColumnNullRule

public NSArray statementsToModifyColumnNullRule(String columnName,
                                                String tableName,
                                                boolean allowsNull,
                                                EOSchemaGenerationOptions options)
Returns null by default. Can be overridden by subclasses to return an array of EOSQLExpressions to modify in place of the column identified by columnName in the table identified by tableName to either allow or not allow NULL values as specified by allowsNull. The options dictionary describes the aspects of the schema for which to create SQL statements.

Specified by:
statementsToModifyColumnNullRule in interface EOSchemaSynchronization
Parameters:
columnName - The name of a column to be modified.
tableName - The name of the table containing the specified column.
allowsNull - A Boolean value to determine whether to allow or not allow NULL values in the specified column.
options - A dictionary describing the aspects of the schema for which to create SQL statements.
Returns:
empty array by default.
See Also:
EOSchemaSynchronization

statementsToRenameColumnNamed

public NSArray statementsToRenameColumnNamed(String columnName,
                                             String tableName,
                                             String newName,
                                             EOSchemaGenerationOptions options)
The default implementation returns null. Can be overridden by subclasses to return an array of EOSQLExpressions to rename the column indentifed by columnName in the table identified by tableName to newName. options is a dictionary describing the aspects of the schema for which to create SQL statements.

Specified by:
statementsToRenameColumnNamed in interface EOSchemaSynchronization
Parameters:
columnName - The name of a column to be renamed.
tableName - The name of the table containing the specified column.
newName - The new name for the specified column.
options - A dictionary describing the aspects of the schema for which to create SQL statements.
Returns:
empty array by default.

statementsToRenameTableNamed

public NSArray statementsToRenameTableNamed(String oldTableName,
                                            String newTableName,
                                            EOSchemaGenerationOptions options)
Description copied from interface: EOSchemaSynchronization
Returns an array of EOSQLExpressions to rename in place the the table indentifed by tableName to newName. options is a dictionary describing the aspects of the schema for which to create SQL statements.

Specified by:
statementsToRenameTableNamed in interface EOSchemaSynchronization
Parameters:
oldTableName - The name of a table to be renamed.
newTableName - The new name for the specified table.
options - A dictionary describing the aspects of the schema for which to create SQL statements.
Returns:
An array of the EOSQLExpressions to rename in place the specified table.

statementsToUpdateObjectStoreForEntityGroups

public NSArray statementsToUpdateObjectStoreForEntityGroups(NSArray 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. entityGroups is an array of entity groups, which are arrays of EOEntity objects that have the same external name. Inserts and deletes columns, and updates modified columns.

Specified by:
statementsToUpdateObjectStoreForEntityGroups in interface EOSchemaSynchronization
Parameters:
entityGroups - An array of entity groups, which are arrays of EOEntity objects that have the same external name.
changes - A dictionary of changes to make to the database schema.
options - A dictionary describing the aspects of the schema for which to create SQL statements.
Returns:
An array of the EOSQLExpressions to update the database table corresponding to entityGroups.
See Also:
EOSchemaSynchronization

statementsToUpdateObjectStoreForModel

public NSArray statementsToUpdateObjectStoreForModel(EOModel model,
                                                     EOSchemaSynchronizationModelChanges changes,
                                                     EOSchemaGenerationOptions options)
Description copied from interface: EOSchemaSynchronization
Returns an array of EOSQLExpressions to synchronize the database with the EOModel model. Prepares the statements to insert and delete new and deleted tables before invoking statementsToUpdateObjectStoreForEntityGroups for each modified table. The changes dictionary identifies the changes to make to the database schema. The options dictionary describes the aspects of the schema for which to create SQL statements.

Specified by:
statementsToUpdateObjectStoreForModel in interface EOSchemaSynchronization
Parameters:
model - The EOModel with which to sychnronize the database.
changes - A dictionary of changes to make to the database schema.
options - A dictionary describing the aspects of the schema for which to create SQL statements.
Returns:
An array of the EOSQLExpressions to synchronize the database with model.
See Also:
#statementsToUpdateObjectStoreForEntityGroups( NSArray model, NSDictionary changes, EOSchemaGenerationOptions options), EOSchemaSynchronization

tableDescriptionForModel

public EOSchemaTableDescription tableDescriptionForModel(String tableName,
                                                         EOModel eomodel)
Description copied from interface: EOSchemaSynchronization
Return a Table Description object that describe the database schema.

Specified by:
tableDescriptionForModel in interface EOSchemaSynchronization
Parameters:
tableName - table name to describe
eomodel - model to introscpect
Returns:

columnDescriptionForTableAndModel

public EOSchemaColumnDescription columnDescriptionForTableAndModel(String columnName,
                                                                   String tableName,
                                                                   EOModel eomodel)
Description copied from interface: EOSchemaSynchronization
Return a Column Description object that describe the database schema.

Specified by:
columnDescriptionForTableAndModel in interface EOSchemaSynchronization
Parameters:
columnName - column name to describe
tableName - table name to describe
eomodel - model to introscpect
Returns:

indexDescriptionForTableAndModel

public EOSchemaIndexDescription indexDescriptionForTableAndModel(String indexName,
                                                                 String tableName,
                                                                 EOModel eomodel)
Description copied from interface: EOSchemaSynchronization
Return an Index Description object that describe the database schema.

Specified by:
indexDescriptionForTableAndModel in interface EOSchemaSynchronization
Parameters:
indexName - index name to describe
tableName - table name to describe
eomodel - model to introscpect
Returns:

supportsDirectColumnCoercion

public boolean supportsDirectColumnCoercion()
The default implementation returns false. Can be overridden by subclasses to return true if the adaptor can change the type of an existing column in place.

Specified by:
supportsDirectColumnCoercion in interface EOSchemaSynchronization
Returns:
true if the adaptor can change the type of an existing column in place.

supportsDirectColumnDeletion

public boolean supportsDirectColumnDeletion()
The default implementation returns false. Can be overridden by subclasses to return true if the adaptor can delete columns.

Specified by:
supportsDirectColumnDeletion in interface EOSchemaSynchronization
Returns:
true if the adaptor can delete columns.

supportsDirectColumnInsertion

public boolean supportsDirectColumnInsertion()
The default implementation returns false. Can be overridden by subclasses to return true if the adaptor can add columns to a table.

Specified by:
supportsDirectColumnInsertion in interface EOSchemaSynchronization
Returns:
true if the adaptor can add columns to a table.

supportsDirectColumnRenaming

public boolean supportsDirectColumnRenaming()
The default implementation returns false. Can be overridden by subclasses to return true if the adaptor can rename columns in a table.

Specified by:
supportsDirectColumnRenaming in interface EOSchemaSynchronization
Returns:
true if the adaptor can rename columns in a table.

supportsDirectColumnNullRuleModification

public boolean supportsDirectColumnNullRuleModification()
The default implementation returns false. Can be overridden by subclasses to return true if the adaptor can modify the null rule of an existing column in place.

Specified by:
supportsDirectColumnNullRuleModification in interface EOSchemaSynchronization
Returns:
true if the adaptor can modify the nullrule of an existing column in place.

supportsSchemaSynchronization

public boolean supportsSchemaSynchronization()
The default implementation returns false. Can be overridden by subclasses to return true if the adaptor can update the database schema to reflect changes in an EOModel.

Specified by:
supportsSchemaSynchronization in interface EOSchemaSynchronization
Returns:
true if the adaptor can update the database schema.

supportsTableDescriptionIntrospection

public boolean supportsTableDescriptionIntrospection()
The default implementation returns false. Can be overridden by subclasses to return true if the adaptor can describe the database schema.

Specified by:
supportsTableDescriptionIntrospection in interface EOSchemaSynchronization
Returns:
true if the adaptor can describe the database schema.

objectStoreChangesFromAttributeToAttribute

public EOSchemaSynchronizationColumnChanges objectStoreChangesFromAttributeToAttribute(EOAttribute schemaAttribute,
                                                                                       EOAttribute modelAttribute)
Description copied from interface: EOSchemaSynchronization
Compares schemaAttribute with modelAttribute and returns a change dictionary of state that is different between the the two. The possible keys in the change dictionary are:

The values in the change dictionary are the corresponding values of schemaAttribute, that is, the values stored in the database.

Specified by:
objectStoreChangesFromAttributeToAttribute in interface EOSchemaSynchronization
Parameters:
schemaAttribute - An EOAttribute as represented in the database.
modelAttribute - An EOAttribute as represented in the EOModel.
Returns:
A change dictionary for the difference in state between schemaAttribute and modelAttribute.

indexDefinitionForEntity

protected NSArray indexDefinitionForEntity(EOEntity entity)
Parameters:
entity -
Returns:

createIndexStatementsForEntityGroups

public NSArray createIndexStatementsForEntityGroups(NSArray entityGroups)
Specified by:
createIndexStatementsForEntityGroups in interface EOSchemaGeneration
Returns:

createIndexStatementsForEntityGroup

public NSArray createIndexStatementsForEntityGroup(NSArray entityGroup)
Specified by:
createIndexStatementsForEntityGroup in interface EOSchemaGeneration

createIndexExpressionsForEntity

protected NSArray createIndexExpressionsForEntity(EOEntity entity,
                                                  EOEntityIndex anIndex,
                                                  EOEntity masterEntity)
Parameters:
entity -
anIndex -
masterEntity -
Returns:

createIndexStatementForEntity

protected String createIndexStatementForEntity(EOEntity entity,
                                               String indexName,
                                               String tableName,
                                               NSArray attributeList)
Parameters:
entity -
indexName -
tableName -
attributeList -
Returns:

dropIndexStatementsForEntityGroups

public NSArray dropIndexStatementsForEntityGroups(NSArray entityGroups)
Specified by:
dropIndexStatementsForEntityGroups in interface EOSchemaGeneration
Returns:

dropIndexStatementsForEntityGroup

public NSArray dropIndexStatementsForEntityGroup(NSArray entityGroup)
Specified by:
dropIndexStatementsForEntityGroup in interface EOSchemaGeneration

dropIndexExpressionsForEntity

protected NSArray dropIndexExpressionsForEntity(EOEntity entity,
                                                EOEntityIndex anIndex,
                                                EOEntity masterEntity)
Parameters:
entity -
anIndex -
masterEntity -
Returns:

dropIndexStatementForEntity

protected String dropIndexStatementForEntity(EOEntity entity,
                                             String indexName,
                                             String tableName)
Parameters:
entity -
indexName -
tableName -
Returns:

Last updated June 2008

Copyright © 2000-2008 Apple Inc.