FileDocCategorySizeDatePackage
DatabaseObjectDefinition.javaAPI DocGlassfish v2 API6216Tue May 22 16:54:54 BST 2007oracle.toplink.essentials.tools.schemaframework

DatabaseObjectDefinition

public abstract class DatabaseObjectDefinition extends Object implements Serializable, Cloneable

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.

Fields Summary
public String
name
public String
qualifier
Constructors Summary
public DatabaseObjectDefinition()

        this.name = "";
        this.qualifier = "";
    
Methods Summary
public abstract java.io.WriterbuildCreationWriter(oracle.toplink.essentials.internal.sessions.AbstractSession session, java.io.Writer writer)
INTERNAL: Returns the writer used for creation of this object.

public abstract java.io.WriterbuildDeletionWriter(oracle.toplink.essentials.internal.sessions.AbstractSession session, java.io.Writer writer)
INTERNAL: Returns the writer used for creation of this object.

public java.lang.Objectclone()
PUBLIC:

        try {
            return super.clone();
        } catch (CloneNotSupportedException impossible) {
            return null;
        }
    
public voidcreateObject(oracle.toplink.essentials.internal.sessions.AbstractSession session, java.io.Writer schemaWriter)
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...

        if (schemaWriter == null) {
            this.createOnDatabase(session);
        } else {
            this.buildCreationWriter(session, schemaWriter);
        }
    
public voidcreateOnDatabase(oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Execute the DDL to create the varray.

        session.executeNonSelectingCall(new SQLCall(buildCreationWriter(session, new StringWriter()).toString()));
    
public voiddropFromDatabase(oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Execute the DDL to drop the varray.

        session.executeNonSelectingCall(new SQLCall(buildDeletionWriter(session, new StringWriter()).toString()));
    
public voiddropObject(oracle.toplink.essentials.internal.sessions.AbstractSession session, java.io.Writer schemaWriter)
INTERNAL: Execute the DDL to drop the varray. Either directly from the database of write out the statement to a file.

        if (schemaWriter == null) {
            this.dropFromDatabase(session);
        } else {
            buildDeletionWriter(session, schemaWriter);
        }
    
public java.lang.StringgetFullName()
INTERNAL: Most major databases support a creator name scope. This means whenever the database object is referecned, it must be qualified.

        if (getQualifier().equals("")) {
            return getName();
        } else {
            return getQualifier() + "." + getName();
        }
    
public java.lang.StringgetName()
PUBLIC: Return the name of the object. i.e. the table name or the sequence name.

        return name;
    
public java.lang.StringgetQualifier()
PUBLIC: Most major databases support a creator name scope. This means whenever the database object is referecned, it must be qualified.

        return qualifier;
    
public voidsetName(java.lang.String name)
PUBLIC: Set the name of the object. i.e. the table name or the sequence name.

        this.name = name;
    
public voidsetQualifier(java.lang.String qualifier)
PUBLIC: Most major databases support a creator name scope. This means whenever the database object is referecned, it must be qualified.

        this.qualifier = qualifier;
    
public java.lang.StringtoString()

        return Helper.getShortClassName(getClass()) + "(" + getFullName() + ")";