Class DatabaseObjectDefinition
- java.lang.Object
-
- org.eclipse.persistence.tools.schemaframework.DatabaseObjectDefinition
-
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
IndexDefinition,NestedTableDefinition,PackageDefinition,SequenceDefinition,StoredProcedureDefinition,TableDefinition,TypeDefinition,VarrayDefinition,ViewDefinition
public abstract class DatabaseObjectDefinition extends Object implements Cloneable, Serializable
Purpose: Define a database object for the purpose of creation and deletion. A database object is an entity such as a table, view, proc, sequence...
Responsibilities:
- Be able to create and drop the object from the database.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DatabaseObjectDefinition()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract WriterbuildCreationWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer)INTERNAL: Returns the writer used for creation of this object.abstract WriterbuildDeletionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer)INTERNAL: Returns the writer used for deletion of this object.WriterbuildVPDCreationFunctionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer)INTERNAL: Sub classes should override.WriterbuildVPDCreationPolicyWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer)INTERNAL: Sub classes should override.WriterbuildVPDDeletionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer)INTERNAL: Sub classes should override.Objectclone()PUBLIC:voidcreateDatabaseSchema(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer, Set<String> createdDatabaseSchemas)INTERNAL: Execute the DDL to create the database schema for this object.voidcreateDatabaseSchemaOnDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session, Set<String> createdDatabaseSchemas)INTERNAL: Execute the DDL to create the database schema for this object.voidcreateObject(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer schemaWriter)INTERNAL: Either drop from the database directly or write the statement to a file.voidcreateOnDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Execute the DDL to create this object.voiddropDatabaseSchema(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer)INTERNAL: Execute the DDL to drop the database schema for this object.voiddropDatabaseSchemaOnDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Execute the DDL to drop the database schema for this object.voiddropFromDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Execute the DDL to drop the object.voiddropObject(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer schemaWriter, boolean createSQLFiles)INTERNAL: Execute the DDL to drop the object.StringgetDatabaseSchema()PUBLIC: Return the database schema associated with this database object.StringgetFullName()INTERNAL: Most major databases support a creator name scope.StringgetName()PUBLIC: Return the name of the object.StringgetQualifier()PUBLIC: Most major databases support a creator name scope.voidpostCreateObject(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer createSchemaWriter, boolean createSQLFiles)Execute any statements required after the creation of the objectvoidpreDropObject(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer dropSchemaWriter, boolean createSQLFiles)Execute any statements required before the deletion of the objectvoidsetName(String name)PUBLIC: Set the name of the object.voidsetQualifier(String qualifier)PUBLIC: Most major databases support a creator name scope.booleanshouldCreateDatabaseSchema(Set<String> createdDatabaseSchemas)INTERNAL: Subclasses who care should override this method, e.g.booleanshouldCreateVPDCalls(org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Subclasses who care should override this method.StringtoString()
-
-
-
Method Detail
-
buildCreationWriter
public abstract Writer buildCreationWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer) throws ValidationException
INTERNAL: Returns the writer used for creation of this object.- Throws:
ValidationException
-
buildVPDCreationPolicyWriter
public Writer buildVPDCreationPolicyWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer)
INTERNAL: Sub classes should override.
-
buildVPDCreationFunctionWriter
public Writer buildVPDCreationFunctionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer)
INTERNAL: Sub classes should override.
-
buildVPDDeletionWriter
public Writer buildVPDDeletionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer)
INTERNAL: Sub classes should override.
-
buildDeletionWriter
public abstract Writer buildDeletionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer) throws ValidationException
INTERNAL: Returns the writer used for deletion of this object.- Throws:
ValidationException
-
clone
public Object clone()
PUBLIC:
-
createDatabaseSchema
public void createDatabaseSchema(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer, Set<String> createdDatabaseSchemas) throws EclipseLinkExceptionINTERNAL: Execute the DDL to create the database schema for this object. Does nothing at this level, subclasses that support this must override this method.- Throws:
EclipseLinkException- See Also:
TableDefinition
-
createDatabaseSchemaOnDatabase
public void createDatabaseSchemaOnDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session, Set<String> createdDatabaseSchemas) throws EclipseLinkExceptionINTERNAL: Execute the DDL to create the database schema for this object. Does nothing at this level, subclasses that support this must override this method.- Throws:
EclipseLinkException- See Also:
TableDefinition
-
createObject
public void createObject(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer schemaWriter) throws EclipseLinkExceptionINTERNAL: Either drop from the database directly or write the statement to a file. Database objects are root level entities such as tables, views, procs, sequences...- Throws:
EclipseLinkException
-
createOnDatabase
public void createOnDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session) throws EclipseLinkExceptionINTERNAL: Execute the DDL to create this object.- Throws:
EclipseLinkException
-
shouldCreateDatabaseSchema
public boolean shouldCreateDatabaseSchema(Set<String> createdDatabaseSchemas)
INTERNAL: Subclasses who care should override this method, e.g. TableDefinition.
-
shouldCreateVPDCalls
public boolean shouldCreateVPDCalls(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL: Subclasses who care should override this method.
-
dropDatabaseSchema
public void dropDatabaseSchema(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer writer) throws EclipseLinkExceptionINTERNAL: Execute the DDL to drop the database schema for this object. Does nothing at this level, subclasses that support this must override this method.- Throws:
EclipseLinkException- See Also:
TableDefinition
-
dropDatabaseSchemaOnDatabase
public void dropDatabaseSchemaOnDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session) throws EclipseLinkExceptionINTERNAL: Execute the DDL to drop the database schema for this object. Does nothing at this level, subclasses that support this must override this method.- Throws:
EclipseLinkException- See Also:
TableDefinition
-
dropFromDatabase
public void dropFromDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session) throws EclipseLinkExceptionINTERNAL: Execute the DDL to drop the object.- Throws:
EclipseLinkException
-
dropObject
public void dropObject(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer schemaWriter, boolean createSQLFiles) throws EclipseLinkExceptionINTERNAL: Execute the DDL to drop the object. Either directly from the database of write out the statement to a file.- Throws:
EclipseLinkException
-
getDatabaseSchema
public String getDatabaseSchema()
PUBLIC: Return the database schema associated with this database object.- See Also:
TableDefinition
-
getFullName
public String getFullName()
INTERNAL: Most major databases support a creator name scope. This means whenever the database object is referenced, it must be qualified.
-
getName
public String getName()
PUBLIC: Return the name of the object. i.e. the table name or the sequence name.
-
getQualifier
public String getQualifier()
PUBLIC: Most major databases support a creator name scope. This means whenever the database object is referenced, it must be qualified.
-
postCreateObject
public void postCreateObject(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer createSchemaWriter, boolean createSQLFiles)Execute any statements required after the creation of the object- Parameters:
session-createSchemaWriter-
-
preDropObject
public void preDropObject(org.eclipse.persistence.internal.sessions.AbstractSession session, Writer dropSchemaWriter, boolean createSQLFiles)Execute any statements required before the deletion of the object- Parameters:
session-dropSchemaWriter-
-
setName
public void setName(String name)
PUBLIC: Set the name of the object. i.e. the table name or the sequence name.
-
setQualifier
public void setQualifier(String qualifier)
PUBLIC: Most major databases support a creator name scope. This means whenever the database object is referenced, it must be qualified.
-
-