public class TableSequenceDefinition extends SequenceDefinition
Purpose: Allow a generic way of creating sequences on the different platforms, and allow optional parameters to be specified.
Modifier and Type | Field and Description |
---|---|
protected boolean |
deleteSchema |
protected TableDefinition |
tableDefinition |
sequence
name, qualifier
Constructor and Description |
---|
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).
|
Modifier and Type | Method and Description |
---|---|
java.io.Writer |
buildCreationWriter(org.eclipse.persistence.internal.sessions.AbstractSession session,
java.io.Writer writer)
INTERNAL:
Return the SQL required to insert the sequence row into the sequence table.
|
java.io.Writer |
buildDeletionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session,
java.io.Writer writer)
INTERNAL:
Return the SQL to delete the row from the sequence table.
|
TableDefinition |
buildTableDefinition()
INTERNAL:
Return a TableDefinition specifying sequence table.
|
boolean |
checkIfExist(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERAL:
Execute the SQL required to insert the sequence row into the sequence table.
|
void |
dropDatabaseSchema(org.eclipse.persistence.internal.sessions.AbstractSession session,
java.io.Writer writer)
INTERNAL:
Execute the DDL to drop the database schema for this object.
|
void |
dropDatabaseSchemaOnDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Execute the DDL to drop the database schema for this object.
|
java.lang.String |
getDatabaseSchema()
PUBLIC:
Return the schema associated with this table sequence.
|
java.lang.String |
getSequenceCounterFieldName()
PUBLIC:
|
java.lang.String |
getSequenceNameFieldName()
PUBLIC:
|
org.eclipse.persistence.internal.helper.DatabaseTable |
getSequenceTable()
Return the database table for the sequence.
|
java.util.List<IndexDefinition> |
getSequenceTableIndexes()
PUBLIC:
|
java.lang.String |
getSequenceTableName()
PUBLIC:
|
java.lang.String |
getSequenceTableQualifier()
PUBLIC:
|
protected TableSequence |
getTableSequence() |
boolean |
isTableSequenceDefinition()
INTERNAL:
|
void |
preDropObject(org.eclipse.persistence.internal.sessions.AbstractSession session,
java.io.Writer dropSchemaWriter,
boolean createSQLFiles)
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.
|
alter, alterOnDatabase, createOnDatabase, isAlterSupported
buildVPDCreationFunctionWriter, buildVPDCreationPolicyWriter, buildVPDDeletionWriter, clone, createDatabaseSchema, createDatabaseSchemaOnDatabase, createObject, dropFromDatabase, dropObject, getFullName, getName, getQualifier, hasDatabaseSchema, postCreateObject, setName, setQualifier, shouldCreateDatabaseSchema, shouldCreateVPDCalls, toString
protected TableDefinition tableDefinition
protected boolean deleteSchema
public TableSequenceDefinition(Sequence sequence, boolean deleteSchema)
public java.io.Writer buildCreationWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, java.io.Writer writer) throws ValidationException
buildCreationWriter
in class DatabaseObjectDefinition
ValidationException
public java.io.Writer buildDeletionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, java.io.Writer writer) throws ValidationException
buildDeletionWriter
in class DatabaseObjectDefinition
ValidationException
public boolean checkIfExist(org.eclipse.persistence.internal.sessions.AbstractSession session) throws DatabaseException
checkIfExist
in class SequenceDefinition
DatabaseException
public void dropDatabaseSchema(org.eclipse.persistence.internal.sessions.AbstractSession session, java.io.Writer writer) throws EclipseLinkException
dropDatabaseSchema
in class DatabaseObjectDefinition
EclipseLinkException
TableDefinition
public void dropDatabaseSchemaOnDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session) throws EclipseLinkException
dropDatabaseSchemaOnDatabase
in class DatabaseObjectDefinition
EclipseLinkException
TableDefinition
public java.lang.String getDatabaseSchema()
getDatabaseSchema
in class DatabaseObjectDefinition
TableDefinition
public java.lang.String getSequenceCounterFieldName()
public java.lang.String getSequenceNameFieldName()
public org.eclipse.persistence.internal.helper.DatabaseTable getSequenceTable()
public java.util.List<IndexDefinition> getSequenceTableIndexes()
public java.lang.String getSequenceTableName()
public java.lang.String getSequenceTableQualifier()
public TableDefinition buildTableDefinition()
buildTableDefinition
in class SequenceDefinition
protected TableSequence getTableSequence()
public boolean isTableSequenceDefinition()
isTableSequenceDefinition
in class SequenceDefinition
public void preDropObject(org.eclipse.persistence.internal.sessions.AbstractSession session, java.io.Writer dropSchemaWriter, boolean createSQLFiles)
preDropObject
in class DatabaseObjectDefinition
session
- dropSchemaWriter
- protected boolean shouldDropTableDefinition()