Module org.eclipse.persistence.core
Class TableSequenceDefinition
java.lang.Object
org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition
org.eclipse.persistence.tools.schemaframework.SequenceDefinition
org.eclipse.persistence.tools.schemaframework.TableSequenceDefinition
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
UnaryTableSequenceDefinition
Purpose: Allow a generic way of creating sequences on the different platforms, and allow optional parameters to be specified.
- See Also:
-
Field Summary
Fields inherited from class org.eclipse.persistence.tools.schemaframework.SequenceDefinition
sequence
Fields inherited from class org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition
name, qualifier
-
Constructor Summary
ConstructorDescriptionTableSequenceDefinition
(Sequence sequence, boolean deleteSchema) INTERNAL: Should be a sequence defining table sequence in the db: either TableSequence DefaultSequence (only if case platform.getDefaultSequence() is a TableSequence). -
Method Summary
Modifier and TypeMethodDescriptionbuildCreationWriter
(AbstractSession session, Writer writer) INTERNAL: Return the SQL required to insert the sequence row into the sequence table.buildDeletionWriter
(AbstractSession session, Writer writer) INTERNAL: Return the SQL to delete the row from the sequence table.INTERNAL: Return a TableDefinition specifying sequence table.boolean
checkIfExist
(AbstractSession session) INTERAL: Execute the SQL required to insert the sequence row into the sequence table.void
dropDatabaseSchema
(AbstractSession session, Writer writer) INTERNAL: Execute the DDL to drop the database schema for this object.void
INTERNAL: Execute the DDL to drop the database schema for this object.PUBLIC: Return the schema associated with this table sequence.PUBLIC:PUBLIC:Return the database table for the sequence.PUBLIC:PUBLIC:PUBLIC:PUBLIC:protected TableSequence
boolean
INTERNAL:void
preDropObject
(AbstractSession session, Writer dropSchemaWriter, boolean createSQLFiles) Execute any statements required before the deletion of the objectprotected boolean
INTERNAL: Returns true if the table definition should be dropped during buildDeletionWriter.Methods inherited from class org.eclipse.persistence.tools.schemaframework.SequenceDefinition
alter, alterOnDatabase, createOnDatabase, isAlterSupported
Methods inherited from class org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition
buildVPDCreationFunctionWriter, buildVPDCreationPolicyWriter, buildVPDDeletionWriter, clone, createDatabaseSchema, createDatabaseSchemaOnDatabase, createObject, dropFromDatabase, dropObject, getFieldTypeDefinition, getFieldTypeDefinition, getFullName, getName, getQualifier, hasDatabaseSchema, postCreateObject, setName, setQualifier, shouldCreateDatabaseSchema, shouldCreateVPDCalls, toString
-
Field Details
-
tableDefinition
-
deleteSchema
protected boolean deleteSchema
-
-
Constructor Details
-
TableSequenceDefinition
INTERNAL: Should be a sequence defining table sequence in the db: either TableSequence DefaultSequence (only if case platform.getDefaultSequence() is a TableSequence).
-
-
Method Details
-
buildCreationWriter
public Writer buildCreationWriter(AbstractSession session, Writer writer) throws ValidationException INTERNAL: Return the SQL required to insert the sequence row into the sequence table. Assume that the sequence table exists.- Specified by:
buildCreationWriter
in classDatabaseObjectDefinition
- Throws:
ValidationException
-
buildDeletionWriter
public Writer buildDeletionWriter(AbstractSession session, Writer writer) throws ValidationException INTERNAL: Return the SQL to delete the row from the sequence table. If we're dealing with create creation, then delegate to the table so that is dropped outright since we will delete the schema.- Specified by:
buildDeletionWriter
in classDatabaseObjectDefinition
- Throws:
ValidationException
-
checkIfExist
INTERAL: Execute the SQL required to insert the sequence row into the sequence table. Assume that the sequence table exists.- Specified by:
checkIfExist
in classSequenceDefinition
- Throws:
DatabaseException
-
dropDatabaseSchema
INTERNAL: Execute the DDL to drop the database schema for this object. Does nothing at this level, subclasses that support this must override this method.- Overrides:
dropDatabaseSchema
in classDatabaseObjectDefinition
- Throws:
EclipseLinkException
- See Also:
-
dropDatabaseSchemaOnDatabase
INTERNAL: Execute the DDL to drop the database schema for this object. Does nothing at this level, subclasses that support this must override this method.- Overrides:
dropDatabaseSchemaOnDatabase
in classDatabaseObjectDefinition
- Throws:
EclipseLinkException
- See Also:
-
getDatabaseSchema
PUBLIC: Return the schema associated with this table sequence.- Overrides:
getDatabaseSchema
in classDatabaseObjectDefinition
- See Also:
-
getSequenceCounterFieldName
PUBLIC: -
getSequenceNameFieldName
PUBLIC: -
getSequenceTable
Return the database table for the sequence. -
getSequenceTableIndexes
PUBLIC: -
getSequenceTableName
PUBLIC: -
getSequenceTableQualifier
PUBLIC: -
getSequenceTableQualifiedName
PUBLIC: -
buildTableDefinition
INTERNAL: Return a TableDefinition specifying sequence table. Cache the table definition for re-use (during CREATE and DROP)- Overrides:
buildTableDefinition
in classSequenceDefinition
-
getTableSequence
-
isTableSequenceDefinition
public boolean isTableSequenceDefinition()INTERNAL:- Overrides:
isTableSequenceDefinition
in classSequenceDefinition
-
preDropObject
Execute any statements required before the deletion of the object- Overrides:
preDropObject
in classDatabaseObjectDefinition
-
shouldDropTableDefinition
protected boolean shouldDropTableDefinition()INTERNAL: Returns true if the table definition should be dropped during buildDeletionWriter.
-