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

public abstract Class DatabaseObjectDefinition

extends Object
implements Cloneable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.lang.Cloneable
Known Direct Subclasses
org.eclipse.persistence.tools.schemaframework.IndexDefinition, org.eclipse.persistence.tools.schemaframework.NestedTableDefinition, org.eclipse.persistence.tools.schemaframework.PackageDefinition, org.eclipse.persistence.tools.schemaframework.SequenceDefinition, org.eclipse.persistence.tools.schemaframework.StoredProcedureDefinition, org.eclipse.persistence.tools.schemaframework.TableDefinition, org.eclipse.persistence.tools.schemaframework.TypeDefinition, org.eclipse.persistence.tools.schemaframework.VarrayDefinition, org.eclipse.persistence.tools.schemaframework.ViewDefinition
Imports
java.io.*, java.util.Map, .Set, org.eclipse.persistence.internal.databaseaccess.DatabasePlatform, .FieldTypeDefinition, org.eclipse.persistence.internal.helper.*, org.eclipse.persistence.internal.sessions.AbstractSession, org.eclipse.persistence.exceptions.*, org.eclipse.persistence.queries.*

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:

Field Summary

Modifier and TypeField and Description
public String
public String

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public abstract Writer
buildCreationWriter(AbstractSession session, Writer writer)

INTERNAL: Returns the writer used for creation of this object.

public abstract Writer
buildDeletionWriter(AbstractSession session, Writer writer)

INTERNAL: Returns the writer used for deletion of this object.

public Writer
buildVPDCreationFunctionWriter(AbstractSession session, Writer writer)

INTERNAL: Sub classes should override.

public Writer
buildVPDCreationPolicyWriter(AbstractSession session, Writer writer)

INTERNAL: Sub classes should override.

public Writer
buildVPDDeletionWriter(AbstractSession session, Writer writer)

INTERNAL: Sub classes should override.

public Object
clone()

Overrides java.lang.Object.clone.

PUBLIC:
public void
createDatabaseSchema(AbstractSession session, Writer writer, Set<String> createdDatabaseSchemas)

INTERNAL: Execute the DDL to create the database schema for this object.

public void
createDatabaseSchemaOnDatabase(AbstractSession session, Set<String> createdDatabaseSchemas)

INTERNAL: Execute the DDL to create the database schema for this object.

public void
createObject(AbstractSession session, Writer schemaWriter)

INTERNAL: Either drop from the database directly or write the statement to a file.

public void
createOnDatabase(AbstractSession session)

INTERNAL: Execute the DDL to create this object.

public void
dropDatabaseSchema(AbstractSession session, Writer writer)

INTERNAL: Execute the DDL to drop the database schema for this object.

public void
dropDatabaseSchemaOnDatabase(AbstractSession session)

INTERNAL: Execute the DDL to drop the database schema for this object.

public void
dropFromDatabase(AbstractSession session)

INTERNAL: Execute the DDL to drop the object.

public void
dropObject(AbstractSession session, Writer schemaWriter, boolean createSQLFiles)

INTERNAL: Execute the DDL to drop the object.

public String
getDatabaseSchema()

PUBLIC: Return the database schema associated with this database object.

protected static final FieldTypeDefinition

Returns:

Database platform specific definition instance.
getFieldTypeDefinition
(final AbstractSession
Session to search for already existing instances.
session
,
final Class<?>
Field type class.
type
,
final String
Filed type name.
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 final FieldTypeDefinition
getFieldTypeDefinition(final DatabasePlatform
Specific database platform handler.
platform
,
final Class<?>
Field type (will be processed first when available).
type
,
final String
Field type name (will be processed as backup option when type class is not available).
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.

public String
getFullName()

INTERNAL: Most major databases support a creator name scope.

public String
getName()

PUBLIC: Return the name of the object.

public 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.

public void
postCreateObject(AbstractSession session, Writer createSchemaWriter, boolean createSQLFiles)

Execute any statements required after the creation of the object

public void
preDropObject(AbstractSession session, Writer dropSchemaWriter, boolean createSQLFiles)

Execute any statements required before the deletion of the object

public void
setName(String name)

PUBLIC: Set the name of the object.

public void
setQualifier(String qualifier)

PUBLIC: Most major databases support a creator name scope.

public boolean
shouldCreateDatabaseSchema(Set<String> createdDatabaseSchemas)

INTERNAL: Subclasses who care should override this method, e.g. TableDefinition.

public boolean
shouldCreateVPDCalls(AbstractSession session)

INTERNAL: Subclasses who care should override this method.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

nameback to summary
public String name
qualifierback to summary
public String qualifier

Constructor Detail

DatabaseObjectDefinitionback to summary
protected DatabaseObjectDefinition()

Method Detail

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

INTERNAL: Returns the writer used for creation of this object.

buildDeletionWriterback to summary
public abstract Writer buildDeletionWriter(AbstractSession session, Writer writer) throws ValidationException

INTERNAL: Returns the writer used for deletion of this object.

buildVPDCreationFunctionWriterback to summary
public Writer buildVPDCreationFunctionWriter(AbstractSession session, Writer writer)

INTERNAL: Sub classes should override.

buildVPDCreationPolicyWriterback to summary
public Writer buildVPDCreationPolicyWriter(AbstractSession session, Writer writer)

INTERNAL: Sub classes should override.

buildVPDDeletionWriterback to summary
public Writer buildVPDDeletionWriter(AbstractSession session, Writer writer)

INTERNAL: Sub classes should override.

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

PUBLIC:

Returns:Object

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
createDatabaseSchemaback to summary
public void createDatabaseSchema(AbstractSession session, Writer writer, Set<String> createdDatabaseSchemas) throws EclipseLinkException

INTERNAL: Execute the DDL to create the database schema for this object. Does nothing at this level, subclasses that support this must override this method.

See Also
TableDefinition
createDatabaseSchemaOnDatabaseback to summary
public void createDatabaseSchemaOnDatabase(AbstractSession session, Set<String> createdDatabaseSchemas) throws EclipseLinkException

INTERNAL: Execute the DDL to create the database schema for this object. Does nothing at this level, subclasses that support this must override this method.

See Also
TableDefinition
createObjectback to summary
public void createObject(AbstractSession session, Writer schemaWriter) throws EclipseLinkException

INTERNAL: 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...

createOnDatabaseback to summary
public void createOnDatabase(AbstractSession session) throws EclipseLinkException

INTERNAL: Execute the DDL to create this object.

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

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.

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

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.

See Also
TableDefinition
dropFromDatabaseback to summary
public void dropFromDatabase(AbstractSession session) throws EclipseLinkException

INTERNAL: Execute the DDL to drop the object.

dropObjectback to summary
public void dropObject(AbstractSession session, Writer schemaWriter, boolean createSQLFiles) throws EclipseLinkException

INTERNAL: Execute the DDL to drop the object. Either directly from the database of write out the statement to a file.

getDatabaseSchemaback to summary
public String getDatabaseSchema()

PUBLIC: Return the database schema associated with this database object.

See Also
TableDefinition
getFieldTypeDefinitionback to summary
protected static final FieldTypeDefinition getFieldTypeDefinition(final AbstractSession session, final Class<?> type, final String name)

INTERNAL: Retrieve a database platform specific definition from session for existing type instance or build a new one when type is null.

Parameters
session:AbstractSession

Session to search for already existing instances.

type:Class<?>

Field type class.

name:String

Filed type name.

Returns:FieldTypeDefinition

Database platform specific definition instance.

Exceptions
ValidationException:
when provided type is not valid database type.
getFieldTypeDefinitionback to summary
protected static final FieldTypeDefinition getFieldTypeDefinition(final DatabasePlatform platform, final Class<?> type, final 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.

Parameters
platform:DatabasePlatform

Specific database platform handler.

type:Class<?>

Field type (will be processed first when available).

name:String

Field type name (will be processed as backup option when type class is not available).

Exceptions
ValidationException:
when provided type is not valid database type.
getFullNameback to summary
public String getFullName()

INTERNAL: Most major databases support a creator name scope. This means whenever the database object is referenced, it must be qualified.

getNameback to summary
public String getName()

PUBLIC: Return the name of the object. i.e. the table name or the sequence name.

getQualifierback to summary
public String getQualifier()

PUBLIC: Most major databases support a creator name scope. This means whenever the database object is referenced, it must be qualified.

hasDatabaseSchemaback to summary
protected boolean hasDatabaseSchema()

INTERNAL: Return true is this database object definition has a schema definition.

postCreateObjectback to summary
public void postCreateObject(AbstractSession session, Writer createSchemaWriter, boolean createSQLFiles)

Execute any statements required after the creation of the object

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

Execute any statements required before the deletion of the object

setNameback to summary
public void setName(String name)

PUBLIC: Set the name of the object. i.e. the table name or the sequence name.

setQualifierback to summary
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.

shouldCreateDatabaseSchemaback to summary
public boolean shouldCreateDatabaseSchema(Set<String> createdDatabaseSchemas)

INTERNAL: Subclasses who care should override this method, e.g. TableDefinition.

shouldCreateVPDCallsback to summary
public boolean shouldCreateVPDCalls(AbstractSession session)

INTERNAL: Subclasses who care should override this method.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override