WebObjects 5.4.2

com.webobjects.jdbcadaptor
Class MySQLPlugIn.MySQLSynchronizationFactory

java.lang.Object
  extended by com.webobjects.eoaccess.synchronization.EOSchemaSynchronizationFactory
      extended by com.webobjects.jdbcadaptor.MySQLPlugIn.MySQLSynchronizationFactory
All Implemented Interfaces:
EOSchemaGeneration, EOSchemaSynchronization
Enclosing class:
MySQLPlugIn

public static class MySQLPlugIn.MySQLSynchronizationFactory
extends EOSchemaSynchronizationFactory


Nested Class Summary
 
Nested classes/interfaces inherited from class com.webobjects.eoaccess.synchronization.EOSchemaSynchronizationFactory
EOSchemaSynchronizationFactory.Delegate
 
Nested classes/interfaces inherited from interface com.webobjects.eoaccess.synchronization.EOSchemaSynchronization
EOSchemaSynchronization.ColumnTypes
 
Constructor Summary
MySQLPlugIn.MySQLSynchronizationFactory(EOAdaptor adaptor)
           
 
Method Summary
 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 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.
 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.
 NSArray statementsToRenameTableNamed(String tableName, String newName, EOSchemaGenerationOptions options)
          Returns an array of EOSQLExpressions to rename in place the the table indentifed by tableName to newName.
 boolean supportsSchemaSynchronization()
          The default implementation returns false.
 
Methods inherited from class com.webobjects.eoaccess.synchronization.EOSchemaSynchronizationFactory
adaptor, appendExpressionToScript, attributeInEntityWithColumnName, columnDescriptionForTableAndModel, createDatabaseStatementsForConnectionDictionary, createIndexExpressionsForEntity, createIndexStatementForEntity, createIndexStatementsForEntityGroup, createIndexStatementsForEntityGroups, createTableStatementsForEntityGroup, createTableStatementsForEntityGroups, dropDatabaseStatementsForConnectionDictionary, dropIndexExpressionsForEntity, dropIndexStatementForEntity, dropIndexStatementsForEntityGroup, dropIndexStatementsForEntityGroups, dropPrimaryKeySupportStatementsForEntityGroup, dropTableStatementsForEntityGroup, dropTableStatementsForEntityGroups, indexDefinitionForEntity, indexDescriptionForTableAndModel, isCaseSensitive, isColumnTypeEquivalentToColumnType, logicalErrorsInChangeDictionaryForModelOptions, newChanges, newOptions, objectStoreChangesFromAttributeToAttribute, phraseCastingColumnNamed, primaryKeyConstraintStatementsForEntityGroup, primaryKeyConstraintStatementsForEntityGroups, primaryKeyEntityGroupsForEntities, primaryKeySupportStatementsForEntityGroup, schemaCreationScriptForEntities, schemaCreationStatementsForEntities, schemaGenerationDelegate, schemaSynchronizationDelegate, setSchemaGenerationDelegate, setSchemaSynchronizationDelegate, statementsToConvertColumnType, statementsToCopyTableNamed, statementsToDeleteColumnNamed, statementsToDropForeignKeyConstraintsOnEntityGroup, statementsToDropForeignKeyConstraintsOnEntityGroups, statementsToDropPrimaryKeyConstraintsOnEntityGroups, statementsToDropPrimaryKeySupportForEntityGroups, statementsToImplementForeignKeyConstraintsOnEntityGroups, statementsToImplementPrimaryKeyConstraintsOnEntityGroups, statementsToImplementPrimaryKeySupportForEntityGroups, statementsToInsertColumnForAttribute, statementsToModifyColumnNullRule, statementsToRenameColumnNamed, statementsToUpdateObjectStoreForEntityGroups, statementsToUpdateObjectStoreForModel, supportsDirectColumnCoercion, supportsDirectColumnDeletion, supportsDirectColumnInsertion, supportsDirectColumnNullRuleModification, supportsDirectColumnRenaming, supportsTableDescriptionIntrospection, tableDescriptionForModel, tableEntityGroupsForEntities
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MySQLPlugIn.MySQLSynchronizationFactory

public MySQLPlugIn.MySQLSynchronizationFactory(EOAdaptor adaptor)
Method Detail

formatTableName

protected String formatTableName(String name)
Description copied from class: EOSchemaSynchronizationFactory
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.

Overrides:
formatTableName in class EOSchemaSynchronizationFactory
Parameters:
name - table name
Returns:
formated name

formatColumnName

protected String formatColumnName(String name)
Description copied from class: EOSchemaSynchronizationFactory
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.

Overrides:
formatColumnName in class EOSchemaSynchronizationFactory
Parameters:
name - column name
Returns:
formated name

primaryKeySupportStatementsForEntityGroups

public NSArray primaryKeySupportStatementsForEntityGroups(NSArray entityGroups)
Description copied from class: EOSchemaSynchronizationFactory
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
Overrides:
primaryKeySupportStatementsForEntityGroups in class EOSchemaSynchronizationFactory
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)
Description copied from class: EOSchemaSynchronizationFactory
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
Overrides:
dropPrimaryKeySupportStatementsForEntityGroups in class EOSchemaSynchronizationFactory
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()

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
Overrides:
foreignKeyConstraintStatementsForRelationship in class EOSchemaSynchronizationFactory
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)

statementsToRenameTableNamed

public NSArray statementsToRenameTableNamed(String tableName,
                                            String newName,
                                            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
Overrides:
statementsToRenameTableNamed in class EOSchemaSynchronizationFactory
Parameters:
tableName - The name of a table to be renamed.
newName - 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.

supportsSchemaSynchronization

public boolean supportsSchemaSynchronization()
Description copied from class: EOSchemaSynchronizationFactory
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
Overrides:
supportsSchemaSynchronization in class EOSchemaSynchronizationFactory
Returns:
true if the adaptor can update the database schema.

Last updated June 2008

Copyright © 2000-2008 Apple Inc.