Top Description Fields Constructors Methods
org.eclipse.persistence.tools.schemaframework

public Class TableSequenceDefinition

extends SequenceDefinition
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.tools.schemaframework.UnaryTableSequenceDefinition
Imports
java.util.List, .Vector, java.io.*, java.math.BigDecimal, org.eclipse.persistence.exceptions.*, org.eclipse.persistence.internal.helper.DatabaseTable, org.eclipse.persistence.internal.sessions.AbstractSession, org.eclipse.persistence.sequencing.Sequence, .DefaultSequence, .TableSequence

Purpose: Allow a generic way of creating sequences on the different platforms, and allow optional parameters to be specified.

Field Summary

Modifier and TypeField and Description
protected boolean
protected TableDefinition
Inherited from org.eclipse.persistence.tools.schemaframework.SequenceDefinition:
sequence

Constructor Summary

AccessConstructor and Description
public
TableSequenceDefinition(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 TypeMethod and Description
public Writer
buildCreationWriter(AbstractSession session, Writer writer)

Implements abstract org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition.buildCreationWriter.

INTERNAL: Return the SQL required to insert the sequence row into the sequence table.
public Writer
buildDeletionWriter(AbstractSession session, Writer writer)

Implements abstract org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition.buildDeletionWriter.

INTERNAL: Return the SQL to delete the row from the sequence table.
public TableDefinition
buildTableDefinition()

Overrides org.eclipse.persistence.tools.schemaframework.SequenceDefinition.buildTableDefinition.

INTERNAL: Return a TableDefinition specifying sequence table.
public boolean
checkIfExist(AbstractSession session)

Implements abstract org.eclipse.persistence.tools.schemaframework.SequenceDefinition.checkIfExist.

INTERAL: Execute the SQL required to insert the sequence row into the sequence table.
public void
dropDatabaseSchema(AbstractSession session, Writer writer)

Overrides org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition.dropDatabaseSchema.

INTERNAL: Execute the DDL to drop the database schema for this object.
public void
public String
getDatabaseSchema()

Overrides org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition.getDatabaseSchema.

PUBLIC: Return the schema associated with this table sequence.
public String
public String
public DatabaseTable
getSequenceTable()

Return the database table for the sequence.

public List<IndexDefinition>
public String
public String
public String
protected TableSequence
public boolean
public void
preDropObject(AbstractSession session, Writer dropSchemaWriter, boolean createSQLFiles)

Overrides org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition.preDropObject.

Execute any statements required before the deletion of the object
protected boolean
shouldDropTableDefinition()

INTERNAL: Returns true if the table definition should be dropped during buildDeletionWriter.

Inherited from org.eclipse.persistence.tools.schemaframework.SequenceDefinition:
alteralterOnDatabasecreateOnDatabaseisAlterSupported

Field Detail

deleteSchemaback to summary
protected boolean deleteSchema
tableDefinitionback to summary
protected TableDefinition tableDefinition

Constructor Detail

TableSequenceDefinitionback to summary
public TableSequenceDefinition(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 Detail

buildCreationWriterback to summary
public Writer buildCreationWriter(AbstractSession session, Writer writer) throws ValidationException

Implements abstract org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition.buildCreationWriter.

INTERNAL: Return the SQL required to insert the sequence row into the sequence table. Assume that the sequence table exists.

Annotations
@Override
buildDeletionWriterback to summary
public Writer buildDeletionWriter(AbstractSession session, Writer writer) throws ValidationException

Implements abstract org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition.buildDeletionWriter.

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.

Annotations
@Override
buildTableDefinitionback to summary
public TableDefinition buildTableDefinition()

Overrides org.eclipse.persistence.tools.schemaframework.SequenceDefinition.buildTableDefinition.

INTERNAL: Return a TableDefinition specifying sequence table. Cache the table definition for re-use (during CREATE and DROP)

Annotations
@Override
checkIfExistback to summary
public boolean checkIfExist(AbstractSession session) throws DatabaseException

Implements abstract org.eclipse.persistence.tools.schemaframework.SequenceDefinition.checkIfExist.

INTERAL: Execute the SQL required to insert the sequence row into the sequence table. Assume that the sequence table exists.

Annotations
@Override
dropDatabaseSchemaback to summary
public void dropDatabaseSchema(AbstractSession session, Writer writer) throws EclipseLinkException

Overrides org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition.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.

Annotations
@Override
See Also
TableDefinition
dropDatabaseSchemaOnDatabaseback to summary
public void dropDatabaseSchemaOnDatabase(AbstractSession session) throws EclipseLinkException

Overrides org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition.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.

Annotations
@Override
See Also
TableDefinition
getDatabaseSchemaback to summary
public String getDatabaseSchema()

Overrides org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition.getDatabaseSchema.

PUBLIC: Return the schema associated with this table sequence.

Annotations
@Override
getSequenceCounterFieldNameback to summary
public String getSequenceCounterFieldName()

PUBLIC:

getSequenceNameFieldNameback to summary
public String getSequenceNameFieldName()

PUBLIC:

getSequenceTableback to summary
public DatabaseTable getSequenceTable()

Return the database table for the sequence.

getSequenceTableIndexesback to summary
public List<IndexDefinition> getSequenceTableIndexes()

PUBLIC:

getSequenceTableNameback to summary
public String getSequenceTableName()

PUBLIC:

getSequenceTableQualifiedNameback to summary
public String getSequenceTableQualifiedName()

PUBLIC:

getSequenceTableQualifierback to summary
public String getSequenceTableQualifier()

PUBLIC:

getTableSequenceback to summary
protected TableSequence getTableSequence()
isTableSequenceDefinitionback to summary
public boolean isTableSequenceDefinition()

Overrides org.eclipse.persistence.tools.schemaframework.SequenceDefinition.isTableSequenceDefinition.

INTERNAL:

Annotations
@Override
preDropObjectback to summary
public void preDropObject(AbstractSession session, Writer dropSchemaWriter, boolean createSQLFiles)

Overrides org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition.preDropObject.

Execute any statements required before the deletion of the object

Annotations
@Override
shouldDropTableDefinitionback to summary
protected boolean shouldDropTableDefinition()

INTERNAL: Returns true if the table definition should be dropped during buildDeletionWriter.