Project Wonder 5.0

com.webobjects.jdbcadaptor
Class PostgresqlSynchronizationFactory

java.lang.Object
  extended by com.webobjects.eoaccess.EOSynchronizationFactory
      extended by com.webobjects.jdbcadaptor.PostgresqlSynchronizationFactory
All Implemented Interfaces:
com.webobjects.eoaccess.EOSchemaGeneration, com.webobjects.eoaccess.EOSchemaSynchronization

public class PostgresqlSynchronizationFactory
extends com.webobjects.eoaccess.EOSynchronizationFactory
implements com.webobjects.eoaccess.EOSchemaGeneration, com.webobjects.eoaccess.EOSchemaSynchronization

A synchronization factory usable outside EOModeler

Author:
giorgio_v

Nested Class Summary
 
Nested classes/interfaces inherited from class com.webobjects.eoaccess.EOSynchronizationFactory
com.webobjects.eoaccess.EOSynchronizationFactory.Delegate
 
Nested classes/interfaces inherited from interface com.webobjects.eoaccess.EOSchemaSynchronization
com.webobjects.eoaccess.EOSchemaSynchronization.ColumnTypes
 
Field Summary
static java.lang.String USING_KEY
           
 
Fields inherited from class com.webobjects.eoaccess.EOSynchronizationFactory
_adaptor
 
Fields inherited from interface com.webobjects.eoaccess.EOSchemaGeneration
CreateDatabaseKey, CreatePrimaryKeySupportKey, CreateTablesKey, DropDatabaseKey, DropPrimaryKeySupportKey, DropTablesKey, ForeignKeyConstraintsKey, PrimaryKeyConstraintsKey
 
Fields inherited from interface com.webobjects.eoaccess.EOSchemaSynchronization
_commentsEnabled, AllowsNullKey, ColumnNameKey, ExternalNameKey, ExternalTypeKey, NameKey, PrecisionKey, RelationshipsKey, ScaleKey, SchemaSynchronizationForeignKeyConstraintsKey, SchemaSynchronizationPrimaryKeyConstraintsKey, SchemaSynchronizationPrimaryKeySupportKey, WidthKey
 
Constructor Summary
PostgresqlSynchronizationFactory(com.webobjects.eoaccess.EOAdaptor adaptor)
           
 
Method Summary
 java.lang.String _columnCreationClauseForAttribute(com.webobjects.eoaccess.EOAttribute attribute)
           
 com.webobjects.foundation.NSArray _foreignKeyConstraintStatementsForEntityGroup(com.webobjects.foundation.NSArray group)
           
protected  boolean _shouldGenerateForeignKeyConstraints(com.webobjects.eoaccess.EORelationship rel)
           
 java.lang.StringBuffer addCreateClauseForAttribute(com.webobjects.eoaccess.EOAttribute eoattribute)
           
 java.lang.String columnTypeStringForAttribute(com.webobjects.eoaccess.EOAttribute attribute)
           
 com.webobjects.foundation.NSArray createTableStatementsForEntityGroup(com.webobjects.foundation.NSArray entityGroup)
          Quote table name if necessary
 com.webobjects.foundation.NSArray dropPrimaryKeySupportStatementsForEntityGroup(com.webobjects.foundation.NSArray entityGroup)
          Generates the PostgreSQL-specific SQL statements to drop the primary key support.
 com.webobjects.foundation.NSArray dropTableStatementsForEntityGroup(com.webobjects.foundation.NSArray entityGroup)
          Generates the PostgreSQL-specific SQL statements to drop tables.
static boolean entityUsesSeparateTable(com.webobjects.eoaccess.EOEntity entity)
           
protected  java.lang.String externalNameForEntityWithoutSchema(com.webobjects.eoaccess.EOEntity entity)
           
 com.webobjects.foundation.NSArray foreignKeyConstraintStatementsForRelationship(com.webobjects.eoaccess.EORelationship relationship)
          Generates the PostgreSQL-specific SQL statements to enforce the foreign key constraints for relationship.
protected  java.lang.String formatColumnName(java.lang.String name)
           
protected  java.lang.String formatTableName(java.lang.String name)
           
protected  boolean isInEntityModeler(com.webobjects.eoaccess.EOModel model)
          Returns true if Entity Modeler is running the operation on this model.
 com.webobjects.foundation.NSArray primaryKeyConstraintStatementsForEntityGroup(com.webobjects.foundation.NSArray entityGroup)
          Generates the PostgreSQL-specific SQL statements to enforce primary key constraints.
 com.webobjects.foundation.NSArray primaryKeySupportStatementsForEntityGroup(com.webobjects.foundation.NSArray entityGroup)
          Generates the PostgreSQL-specific SQL statements to create the primary key support.
static java.lang.String replaceStringByStringInString(java.lang.String old, java.lang.String newString, java.lang.String buffer)
          Replaces a given string by another string in a string.
 java.lang.String schemaCreationScriptForEntities(com.webobjects.foundation.NSArray allEntities, com.webobjects.foundation.NSDictionary options)
           
 com.webobjects.foundation.NSArray schemaCreationStatementsForEntities(com.webobjects.foundation.NSArray allEntities, com.webobjects.foundation.NSDictionary options)
           
 com.webobjects.foundation.NSArray statementsToConvertColumnType(java.lang.String columnName, java.lang.String tableName, com.webobjects.eoaccess.EOSchemaSynchronization.ColumnTypes oldType, com.webobjects.eoaccess.EOSchemaSynchronization.ColumnTypes newType, com.webobjects.foundation.NSDictionary options)
           
 com.webobjects.foundation.NSArray statementsToDeleteColumnNamed(java.lang.String columnName, java.lang.String tableName, com.webobjects.foundation.NSDictionary options)
           
 com.webobjects.foundation.NSArray statementsToInsertColumnForAttribute(com.webobjects.eoaccess.EOAttribute attribute, com.webobjects.foundation.NSDictionary options)
           
 com.webobjects.foundation.NSArray statementsToModifyColumnNullRule(java.lang.String columnName, java.lang.String tableName, boolean allowsNull, com.webobjects.foundation.NSDictionary nsdictionary)
           
 com.webobjects.foundation.NSArray statementsToRenameColumnNamed(java.lang.String columnName, java.lang.String tableName, java.lang.String newName, com.webobjects.foundation.NSDictionary nsdictionary)
           
 com.webobjects.foundation.NSArray statementsToRenameTableNamed(java.lang.String tableName, java.lang.String newName, com.webobjects.foundation.NSDictionary options)
           
 
Methods inherited from class com.webobjects.eoaccess.EOSynchronizationFactory
_allowsNullForColumnNamed, _alterPhraseCoercingColumnsWithNames, _alterPhraseDeletingColumnsWithNames, _alterPhraseInsertingColumnsWithNames, _alterPhraseInsertionClausePrefixAtIndex, _alterPhraseJoinString, _arePurelyForeignKeyConstraintRelatedChanges, _canConvertColumnOfTypeToTypeOptions, _columnAttributesInEntityGroup, _columnTypeForAttribute, _columnTypeForChangeDictionaryAndAttribute, _columnTypeNamedWithPrecisionScaleAndWidth, _directCoercionsForEntityGroupInTable, _entityGroupInModelForTableNamed, _entityGroupsInModelReferringToTableNamed, _EOSchemaGenerationOptions, _expressionForEntity, _expressionForString, _firstAttributeInEntityGroupWithColumnName, _intForExpressionStringAdaptorChannel, _isPoorlyFormedColumnType, _isSignificantExceptionAtIndexOfSynchronizationStatements, _isTableCopyingRequiredByColumnChangesToEntityGroup, _isTableNamed, _nameInObjectStoreForEntityGroupWithChangeDictionary, _namesOfColumnsCoercedInChangeDictionaryForEntityGroup, _nullCountForColumnNamedInTableNamedBeneathModel, _parameterizedTypes, _prettyDictionary, _primaryKeyEntityGroupsForEntityGroups, _rowCountForTableNamedBeneathModel, _schemaCreationStatementsForEntityGroup, _schemaSynchronizationAdaptor, _schemaSynchronizationAdaptorChannelForModel, _schemaSynchronizationCommentsEnabled, _setSchemaSynchronizationCommentsEnabled, _sqlReplacements, _statementsCommentedWithString, _statementsToCreateTableForEntityGroupOptions, _statementsToDeleteTableNamedOptions, _statementsToDirectlyUpdateObjectStoreForEntityGroup, _statementsToDropPrimaryKeyConstraintsOnTableNamed, _statementsToIndirectlyUpdateObjectStoreForEntityGroupWithChangeDictionaryOptions, _statementsToUpdateObjectStoreForEntityGroup, _tableNameMapInChangeDictionary, _temporaryNameForTableName, adaptor, appendExpressionToScript, createDatabaseStatementsForConnectionDictionary, createTableStatementsForEntityGroups, dropDatabaseStatementsForConnectionDictionary, dropPrimaryKeySupportStatementsForEntityGroups, dropTableStatementsForEntityGroups, isCaseSensitive, isColumnTypeEquivalentToColumnType, logicalErrorsInChangeDictionaryForModelOptions, objectStoreChangesFromAttributeToAttribute, phraseCastingColumnNamed, primaryKeyConstraintStatementsForEntityGroups, primaryKeyEntityGroupsForEntities, primaryKeySupportStatementsForEntityGroups, schemaSynchronizationDelegate, setSchemaSynchronizationDelegate, statementsToCopyTableNamed, statementsToDropForeignKeyConstraintsOnEntityGroups, statementsToDropPrimaryKeyConstraintsOnEntityGroups, statementsToDropPrimaryKeySupportForEntityGroups, statementsToImplementForeignKeyConstraintsOnEntityGroups, statementsToImplementPrimaryKeyConstraintsOnEntityGroups, statementsToImplementPrimaryKeySupportForEntityGroups, statementsToUpdateObjectStoreForEntityGroups, statementsToUpdateObjectStoreForModel, supportsDirectColumnCoercion, supportsDirectColumnDeletion, supportsDirectColumnInsertion, supportsDirectColumnNullRuleModification, supportsDirectColumnRenaming, supportsSchemaSynchronization, tableEntityGroupsForEntities
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.webobjects.eoaccess.EOSchemaGeneration
appendExpressionToScript, createDatabaseStatementsForConnectionDictionary, createTableStatementsForEntityGroups, dropDatabaseStatementsForConnectionDictionary, dropPrimaryKeySupportStatementsForEntityGroups, dropTableStatementsForEntityGroups, primaryKeyConstraintStatementsForEntityGroups, primaryKeySupportStatementsForEntityGroups
 
Methods inherited from interface com.webobjects.eoaccess.EOSchemaSynchronization
isColumnTypeEquivalentToColumnType, objectStoreChangesFromAttributeToAttribute, phraseCastingColumnNamed, statementsToCopyTableNamed, statementsToDropForeignKeyConstraintsOnEntityGroups, statementsToDropPrimaryKeyConstraintsOnEntityGroups, statementsToDropPrimaryKeySupportForEntityGroups, statementsToImplementForeignKeyConstraintsOnEntityGroups, statementsToImplementPrimaryKeyConstraintsOnEntityGroups, statementsToImplementPrimaryKeySupportForEntityGroups, statementsToUpdateObjectStoreForEntityGroups, statementsToUpdateObjectStoreForModel, supportsDirectColumnCoercion, supportsDirectColumnDeletion, supportsDirectColumnInsertion, supportsDirectColumnNullRuleModification, supportsDirectColumnRenaming, supportsSchemaSynchronization
 

Field Detail

USING_KEY

public static final java.lang.String USING_KEY
See Also:
Constant Field Values
Constructor Detail

PostgresqlSynchronizationFactory

public PostgresqlSynchronizationFactory(com.webobjects.eoaccess.EOAdaptor adaptor)
Method Detail

_columnCreationClauseForAttribute

public java.lang.String _columnCreationClauseForAttribute(com.webobjects.eoaccess.EOAttribute attribute)
Overrides:
_columnCreationClauseForAttribute in class com.webobjects.eoaccess.EOSynchronizationFactory

addCreateClauseForAttribute

public java.lang.StringBuffer addCreateClauseForAttribute(com.webobjects.eoaccess.EOAttribute eoattribute)

formatTableName

protected java.lang.String formatTableName(java.lang.String name)

formatColumnName

protected java.lang.String formatColumnName(java.lang.String name)

_foreignKeyConstraintStatementsForEntityGroup

public com.webobjects.foundation.NSArray _foreignKeyConstraintStatementsForEntityGroup(com.webobjects.foundation.NSArray group)
Overrides:
_foreignKeyConstraintStatementsForEntityGroup in class com.webobjects.eoaccess.EOSynchronizationFactory

_shouldGenerateForeignKeyConstraints

protected boolean _shouldGenerateForeignKeyConstraints(com.webobjects.eoaccess.EORelationship rel)

dropPrimaryKeySupportStatementsForEntityGroup

public com.webobjects.foundation.NSArray dropPrimaryKeySupportStatementsForEntityGroup(com.webobjects.foundation.NSArray entityGroup)
Generates the PostgreSQL-specific SQL statements to drop the primary key support.

Specified by:
dropPrimaryKeySupportStatementsForEntityGroup in interface com.webobjects.eoaccess.EOSchemaGeneration
Overrides:
dropPrimaryKeySupportStatementsForEntityGroup in class com.webobjects.eoaccess.EOSynchronizationFactory
Parameters:
entityGroup - an array of EOEntity objects
Returns:
the array of SQL statements

dropTableStatementsForEntityGroup

public com.webobjects.foundation.NSArray dropTableStatementsForEntityGroup(com.webobjects.foundation.NSArray entityGroup)
Generates the PostgreSQL-specific SQL statements to drop tables.

Specified by:
dropTableStatementsForEntityGroup in interface com.webobjects.eoaccess.EOSchemaGeneration
Overrides:
dropTableStatementsForEntityGroup in class com.webobjects.eoaccess.EOSynchronizationFactory
Parameters:
entityGroup - an array of EOEntity objects
Returns:
the array of SQL statements

foreignKeyConstraintStatementsForRelationship

public com.webobjects.foundation.NSArray foreignKeyConstraintStatementsForRelationship(com.webobjects.eoaccess.EORelationship relationship)
Generates the PostgreSQL-specific SQL statements to enforce the foreign key constraints for relationship.

Specified by:
foreignKeyConstraintStatementsForRelationship in interface com.webobjects.eoaccess.EOSchemaGeneration
Overrides:
foreignKeyConstraintStatementsForRelationship in class com.webobjects.eoaccess.EOSynchronizationFactory
Parameters:
relationship - the relationship, as represented by EOF
Returns:
the array of SQL statements

externalNameForEntityWithoutSchema

protected java.lang.String externalNameForEntityWithoutSchema(com.webobjects.eoaccess.EOEntity entity)

primaryKeyConstraintStatementsForEntityGroup

public com.webobjects.foundation.NSArray primaryKeyConstraintStatementsForEntityGroup(com.webobjects.foundation.NSArray entityGroup)
Generates the PostgreSQL-specific SQL statements to enforce primary key constraints.

Specified by:
primaryKeyConstraintStatementsForEntityGroup in interface com.webobjects.eoaccess.EOSchemaGeneration
Overrides:
primaryKeyConstraintStatementsForEntityGroup in class com.webobjects.eoaccess.EOSynchronizationFactory
Parameters:
entityGroup - an array of EOEntity objects
Returns:
the array of SQL statements

isInEntityModeler

protected boolean isInEntityModeler(com.webobjects.eoaccess.EOModel model)
Returns true if Entity Modeler is running the operation on this model.

Parameters:
model - the model to check
Returns:
true if Entity Modeler is running

primaryKeySupportStatementsForEntityGroup

public com.webobjects.foundation.NSArray primaryKeySupportStatementsForEntityGroup(com.webobjects.foundation.NSArray entityGroup)
Generates the PostgreSQL-specific SQL statements to create the primary key support.

Specified by:
primaryKeySupportStatementsForEntityGroup in interface com.webobjects.eoaccess.EOSchemaGeneration
Overrides:
primaryKeySupportStatementsForEntityGroup in class com.webobjects.eoaccess.EOSynchronizationFactory
Parameters:
entityGroup - an array of EOEntity objects
Returns:
the array of SQL statements

entityUsesSeparateTable

public static boolean entityUsesSeparateTable(com.webobjects.eoaccess.EOEntity entity)

createTableStatementsForEntityGroup

public com.webobjects.foundation.NSArray createTableStatementsForEntityGroup(com.webobjects.foundation.NSArray entityGroup)
Quote table name if necessary

Specified by:
createTableStatementsForEntityGroup in interface com.webobjects.eoaccess.EOSchemaGeneration
Overrides:
createTableStatementsForEntityGroup in class com.webobjects.eoaccess.EOSynchronizationFactory

replaceStringByStringInString

public static java.lang.String replaceStringByStringInString(java.lang.String old,
                                                             java.lang.String newString,
                                                             java.lang.String buffer)
Replaces a given string by another string in a string.

Parameters:
old - string to be replaced
newString - to be inserted
buffer - string to have the replacement done on it
Returns:
string after having all of the replacement done.

columnTypeStringForAttribute

public java.lang.String columnTypeStringForAttribute(com.webobjects.eoaccess.EOAttribute attribute)

statementsToModifyColumnNullRule

public com.webobjects.foundation.NSArray statementsToModifyColumnNullRule(java.lang.String columnName,
                                                                          java.lang.String tableName,
                                                                          boolean allowsNull,
                                                                          com.webobjects.foundation.NSDictionary nsdictionary)
Specified by:
statementsToModifyColumnNullRule in interface com.webobjects.eoaccess.EOSchemaSynchronization
Overrides:
statementsToModifyColumnNullRule in class com.webobjects.eoaccess.EOSynchronizationFactory

statementsToConvertColumnType

public com.webobjects.foundation.NSArray statementsToConvertColumnType(java.lang.String columnName,
                                                                       java.lang.String tableName,
                                                                       com.webobjects.eoaccess.EOSchemaSynchronization.ColumnTypes oldType,
                                                                       com.webobjects.eoaccess.EOSchemaSynchronization.ColumnTypes newType,
                                                                       com.webobjects.foundation.NSDictionary options)
Specified by:
statementsToConvertColumnType in interface com.webobjects.eoaccess.EOSchemaSynchronization
Overrides:
statementsToConvertColumnType in class com.webobjects.eoaccess.EOSynchronizationFactory

statementsToRenameColumnNamed

public com.webobjects.foundation.NSArray statementsToRenameColumnNamed(java.lang.String columnName,
                                                                       java.lang.String tableName,
                                                                       java.lang.String newName,
                                                                       com.webobjects.foundation.NSDictionary nsdictionary)
Specified by:
statementsToRenameColumnNamed in interface com.webobjects.eoaccess.EOSchemaSynchronization
Overrides:
statementsToRenameColumnNamed in class com.webobjects.eoaccess.EOSynchronizationFactory

statementsToInsertColumnForAttribute

public com.webobjects.foundation.NSArray statementsToInsertColumnForAttribute(com.webobjects.eoaccess.EOAttribute attribute,
                                                                              com.webobjects.foundation.NSDictionary options)
Specified by:
statementsToInsertColumnForAttribute in interface com.webobjects.eoaccess.EOSchemaSynchronization
Overrides:
statementsToInsertColumnForAttribute in class com.webobjects.eoaccess.EOSynchronizationFactory

statementsToRenameTableNamed

public com.webobjects.foundation.NSArray statementsToRenameTableNamed(java.lang.String tableName,
                                                                      java.lang.String newName,
                                                                      com.webobjects.foundation.NSDictionary options)
Specified by:
statementsToRenameTableNamed in interface com.webobjects.eoaccess.EOSchemaSynchronization
Overrides:
statementsToRenameTableNamed in class com.webobjects.eoaccess.EOSynchronizationFactory

statementsToDeleteColumnNamed

public com.webobjects.foundation.NSArray statementsToDeleteColumnNamed(java.lang.String columnName,
                                                                       java.lang.String tableName,
                                                                       com.webobjects.foundation.NSDictionary options)
Specified by:
statementsToDeleteColumnNamed in interface com.webobjects.eoaccess.EOSchemaSynchronization
Overrides:
statementsToDeleteColumnNamed in class com.webobjects.eoaccess.EOSynchronizationFactory

schemaCreationScriptForEntities

public java.lang.String schemaCreationScriptForEntities(com.webobjects.foundation.NSArray allEntities,
                                                        com.webobjects.foundation.NSDictionary options)
Specified by:
schemaCreationScriptForEntities in interface com.webobjects.eoaccess.EOSchemaGeneration
Overrides:
schemaCreationScriptForEntities in class com.webobjects.eoaccess.EOSynchronizationFactory

schemaCreationStatementsForEntities

public com.webobjects.foundation.NSArray schemaCreationStatementsForEntities(com.webobjects.foundation.NSArray allEntities,
                                                                             com.webobjects.foundation.NSDictionary options)
Specified by:
schemaCreationStatementsForEntities in interface com.webobjects.eoaccess.EOSchemaGeneration
Overrides:
schemaCreationStatementsForEntities in class com.webobjects.eoaccess.EOSynchronizationFactory

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.