public abstract class DatabaseObjectDefinition
extends java.lang.Object
implements java.lang.Cloneable, java.io.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:
Modifier and Type | Field and Description |
---|---|
java.lang.String |
name |
java.lang.String |
qualifier |
Constructor and Description |
---|
DatabaseObjectDefinition() |
Modifier and Type | Method and Description |
---|---|
abstract java.io.Writer |
buildCreationWriter(org.eclipse.persistence.internal.sessions.AbstractSession session,
java.io.Writer writer)
INTERNAL:
Returns the writer used for creation of this object.
|
abstract java.io.Writer |
buildDeletionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session,
java.io.Writer writer)
INTERNAL:
Returns the writer used for deletion of this object.
|
java.io.Writer |
buildVPDCreationFunctionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session,
java.io.Writer writer)
INTERNAL:
Sub classes should override.
|
java.io.Writer |
buildVPDCreationPolicyWriter(org.eclipse.persistence.internal.sessions.AbstractSession session,
java.io.Writer writer)
INTERNAL:
Sub classes should override.
|
java.io.Writer |
buildVPDDeletionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session,
java.io.Writer writer)
INTERNAL:
Sub classes should override.
|
java.lang.Object |
clone()
PUBLIC:
|
void |
createDatabaseSchema(org.eclipse.persistence.internal.sessions.AbstractSession session,
java.io.Writer writer,
java.util.Set<java.lang.String> createdDatabaseSchemas)
INTERNAL:
Execute the DDL to create the database schema for this object.
|
void |
createDatabaseSchemaOnDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session,
java.util.Set<java.lang.String> createdDatabaseSchemas)
INTERNAL:
Execute the DDL to create the database schema for this object.
|
void |
createObject(org.eclipse.persistence.internal.sessions.AbstractSession session,
java.io.Writer schemaWriter)
INTERNAL:
Either drop from the database directly or write the statement to a file.
|
void |
createOnDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Execute the DDL to create this object.
|
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.
|
void |
dropFromDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Execute the DDL to drop the object.
|
void |
dropObject(org.eclipse.persistence.internal.sessions.AbstractSession session,
java.io.Writer schemaWriter,
boolean createSQLFiles)
INTERNAL:
Execute the DDL to drop the object.
|
java.lang.String |
getDatabaseSchema()
PUBLIC:
Return the database schema associated with this database object.
|
protected static org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition |
getFieldTypeDefinition(org.eclipse.persistence.internal.sessions.AbstractSession session,
java.lang.Class type,
java.lang.String name)
INTERNAL:
Retrieve a database platform specific definition from session for
existing type instance or build a new one when type is
null . |
protected static org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition |
getFieldTypeDefinition(org.eclipse.persistence.internal.databaseaccess.DatabasePlatform platform,
java.lang.Class type,
java.lang.String name)
INTERNAL:
Retrieve database platform specific field definition from database
specific platform handler for existing type or build a new one when type
is
null and type for type name could not be found. |
java.lang.String |
getFullName()
INTERNAL:
Most major databases support a creator name scope.
|
java.lang.String |
getName()
PUBLIC:
Return the name of the object.
|
java.lang.String |
getQualifier()
PUBLIC:
Most major databases support a creator name scope.
|
protected boolean |
hasDatabaseSchema()
INTERNAL:
Return true is this database object definition has a schema definition.
|
void |
postCreateObject(org.eclipse.persistence.internal.sessions.AbstractSession session,
java.io.Writer createSchemaWriter,
boolean createSQLFiles)
Execute any statements required after the creation of the object
|
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
|
void |
setName(java.lang.String name)
PUBLIC:
Set the name of the object.
|
void |
setQualifier(java.lang.String qualifier)
PUBLIC:
Most major databases support a creator name scope.
|
boolean |
shouldCreateDatabaseSchema(java.util.Set<java.lang.String> createdDatabaseSchemas)
INTERNAL:
Subclasses who care should override this method, e.g.
|
boolean |
shouldCreateVPDCalls(org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Subclasses who care should override this method.
|
java.lang.String |
toString() |
protected static final org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition getFieldTypeDefinition(org.eclipse.persistence.internal.sessions.AbstractSession session, java.lang.Class type, java.lang.String name)
null
.session
- Session to search for already existing instances.type
- Field type class.name
- Filed type name.ValidationException
- when provided type is not valid database type.protected static final org.eclipse.persistence.internal.databaseaccess.FieldTypeDefinition getFieldTypeDefinition(org.eclipse.persistence.internal.databaseaccess.DatabasePlatform platform, java.lang.Class type, java.lang.String name)
null
and type for type name could not be found.platform
- Specific database platform handler.type
- Field type (will be processed first when available).name
- Field type name (will be processed as backup option when
type class is not available).ValidationException
- when provided type is not valid database type.public abstract java.io.Writer buildCreationWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, java.io.Writer writer) throws ValidationException
ValidationException
public java.io.Writer buildVPDCreationPolicyWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, java.io.Writer writer)
public java.io.Writer buildVPDCreationFunctionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, java.io.Writer writer)
public java.io.Writer buildVPDDeletionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, java.io.Writer writer)
public abstract java.io.Writer buildDeletionWriter(org.eclipse.persistence.internal.sessions.AbstractSession session, java.io.Writer writer) throws ValidationException
ValidationException
public java.lang.Object clone()
clone
in class java.lang.Object
public void createDatabaseSchema(org.eclipse.persistence.internal.sessions.AbstractSession session, java.io.Writer writer, java.util.Set<java.lang.String> createdDatabaseSchemas) throws EclipseLinkException
EclipseLinkException
TableDefinition
public void createDatabaseSchemaOnDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session, java.util.Set<java.lang.String> createdDatabaseSchemas) throws EclipseLinkException
EclipseLinkException
TableDefinition
public void createObject(org.eclipse.persistence.internal.sessions.AbstractSession session, java.io.Writer schemaWriter) throws EclipseLinkException
EclipseLinkException
public void createOnDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session) throws EclipseLinkException
EclipseLinkException
public boolean shouldCreateDatabaseSchema(java.util.Set<java.lang.String> createdDatabaseSchemas)
public boolean shouldCreateVPDCalls(org.eclipse.persistence.internal.sessions.AbstractSession session)
public void dropDatabaseSchema(org.eclipse.persistence.internal.sessions.AbstractSession session, java.io.Writer writer) throws EclipseLinkException
EclipseLinkException
TableDefinition
public void dropDatabaseSchemaOnDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session) throws EclipseLinkException
EclipseLinkException
TableDefinition
public void dropFromDatabase(org.eclipse.persistence.internal.sessions.AbstractSession session) throws EclipseLinkException
EclipseLinkException
public void dropObject(org.eclipse.persistence.internal.sessions.AbstractSession session, java.io.Writer schemaWriter, boolean createSQLFiles) throws EclipseLinkException
EclipseLinkException
public java.lang.String getDatabaseSchema()
TableDefinition
public java.lang.String getFullName()
public java.lang.String getName()
public java.lang.String getQualifier()
protected boolean hasDatabaseSchema()
public void postCreateObject(org.eclipse.persistence.internal.sessions.AbstractSession session, java.io.Writer createSchemaWriter, boolean createSQLFiles)
session
- createSchemaWriter
- public void preDropObject(org.eclipse.persistence.internal.sessions.AbstractSession session, java.io.Writer dropSchemaWriter, boolean createSQLFiles)
session
- dropSchemaWriter
- public void setName(java.lang.String name)
public void setQualifier(java.lang.String qualifier)
public java.lang.String toString()
toString
in class java.lang.Object