Oracle Fusion Middleware Java API Reference for Oracle TopLink (Deprecated)
11g Release 1 (11.1.1)

B32476-04

oracle.toplink.tools.schemaframework
Class TableDefinition

java.lang.Object
  extended by oracle.toplink.tools.schemaframework.DatabaseObjectDefinition
      extended by oracle.toplink.tools.schemaframework.TableDefinition
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
TypeTableDefinition

public class TableDefinition
extends DatabaseObjectDefinition

Purpose: Allow a generic way of creating tables on the different platforms.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class oracle.toplink.tools.schemaframework.DatabaseObjectDefinition
name, qualifier
 
Constructor Summary
TableDefinition()
           
 
Method Summary
 void addField(FieldDefinition field)
          Add the field to the table.
 void addField(java.lang.String fieldName, java.lang.Class type)
          Add the field to the table, default sizes are used.
 void addField(java.lang.String fieldName, java.lang.Class type, int fieldSize)
          Add the field to the table.
 void addField(java.lang.String fieldName, java.lang.Class type, int fieldSize, int fieldSubSize)
          Add the field to the table.
 void addField(java.lang.String fieldName, java.lang.String typeName)
          Add the field to the type to a nested type.
 void addForeignKeyConstraint(ForeignKeyConstraint foreignKey)
          Add a foreign key constraint to the table.
 void addForeignKeyConstraint(java.lang.String name, java.lang.String sourceField, java.lang.String targetField, java.lang.String targetTable)
          Add a foreign key constraint to the table.
 void addIdentityField(java.lang.String fieldName, java.lang.Class type)
          Add the field to the table, default sizes are used.
 void addIdentityField(java.lang.String fieldName, java.lang.Class type, int fieldSize)
          Add the field to the table, default sizes are used.
 void addPrimaryKeyField(java.lang.String fieldName, java.lang.Class type)
          Add the field to the table, default sizes are used.
 void addPrimaryKeyField(java.lang.String fieldName, java.lang.Class type, int fieldSize)
          Add the field to the table, default sizes are used.
 void addUniqueKeyConstraint(java.lang.String name, java.lang.String sourceField)
          Add a unique key constraint to the table.
 void addUniqueKeyConstraint(java.lang.String name, java.lang.String[] sourceFields)
          Add a unique key constraint to the table.
 void addUniqueKeyConstraint(UniqueKeyConstraint uniqueKey)
          Add a unique key constraint to the table.
 java.lang.Object clone()
          Performs a deep copy of this table definition.
 java.util.Vector getFields()
          
 java.util.Vector<ForeignKeyConstraint> getForeignKeys()
          Returns the ForeignKeyConstraint list.
 java.util.Vector getPrimaryKeyFieldNames()
          
 java.util.Vector<UniqueKeyConstraint> getUniqueKeys()
          
 void setCreateSQLFiles(boolean genFlag)
          
 void setFields(java.util.Vector fields)
          
 void setForeignKeys(java.util.Vector<ForeignKeyConstraint> foreignKeys)
          Set the ForeignKeyConstraint list.
 void setUniqueKeys(java.util.Vector<UniqueKeyConstraint> uniqueKeys)
          
 
Methods inherited from class oracle.toplink.tools.schemaframework.DatabaseObjectDefinition
getName, getQualifier, setName, setQualifier, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TableDefinition

public TableDefinition()
Method Detail

addField

public void addField(java.lang.String fieldName,
                     java.lang.Class type)
Add the field to the table, default sizes are used.

Parameters:
type - is the Java class type coresponding to the database type.

addField

public void addField(java.lang.String fieldName,
                     java.lang.Class type,
                     int fieldSize)
Add the field to the table.

Parameters:
type - is the Java class type coresponding to the database type.

addField

public void addField(java.lang.String fieldName,
                     java.lang.Class type,
                     int fieldSize,
                     int fieldSubSize)
Add the field to the table.

Parameters:
type - is the Java class type coresponding to the database type.

addField

public void addField(java.lang.String fieldName,
                     java.lang.String typeName)
Add the field to the type to a nested type.

Parameters:
typeName - is the name of the nested type.

addField

public void addField(FieldDefinition field)
Add the field to the table.


addForeignKeyConstraint

public void addForeignKeyConstraint(java.lang.String name,
                                    java.lang.String sourceField,
                                    java.lang.String targetField,
                                    java.lang.String targetTable)
Add a foreign key constraint to the table. If there is a same name foreign key constraint already, nothing will happen.


addUniqueKeyConstraint

public void addUniqueKeyConstraint(java.lang.String name,
                                   java.lang.String sourceField)
Add a unique key constraint to the table.


addUniqueKeyConstraint

public void addUniqueKeyConstraint(java.lang.String name,
                                   java.lang.String[] sourceFields)
Add a unique key constraint to the table.


addForeignKeyConstraint

public void addForeignKeyConstraint(ForeignKeyConstraint foreignKey)
Add a foreign key constraint to the table. If there is a same name foreign key constraint already, nothing will happen.


addUniqueKeyConstraint

public void addUniqueKeyConstraint(UniqueKeyConstraint uniqueKey)
Add a unique key constraint to the table.


addIdentityField

public void addIdentityField(java.lang.String fieldName,
                             java.lang.Class type)
Add the field to the table, default sizes are used. Identity fields are used on Sybase for native sequencing, The field must be of numberish type and cannot have a subsize.

Parameters:
type - is the Java class type coresponding to the database type.

addIdentityField

public void addIdentityField(java.lang.String fieldName,
                             java.lang.Class type,
                             int fieldSize)
Add the field to the table, default sizes are used. Identity fields are used on Sybase for native sequencing, The field must be of numberish type and cannot have a subsize.

Parameters:
type - is the Java class type coresponding to the database type.

addPrimaryKeyField

public void addPrimaryKeyField(java.lang.String fieldName,
                               java.lang.Class type)
Add the field to the table, default sizes are used. This field is set as part of the primary key.

Parameters:
type - is the Java class type coresponding to the database type.

addPrimaryKeyField

public void addPrimaryKeyField(java.lang.String fieldName,
                               java.lang.Class type,
                               int fieldSize)
Add the field to the table, default sizes are used. This field is set as part of the primary key.

Parameters:
type - is the Java class type coresponding to the database type.

clone

public java.lang.Object clone()
Performs a deep copy of this table definition.

Overrides:
clone in class DatabaseObjectDefinition

getFields

public java.util.Vector getFields()


getForeignKeys

public java.util.Vector<ForeignKeyConstraint> getForeignKeys()
Returns the ForeignKeyConstraint list.


getUniqueKeys

public java.util.Vector<UniqueKeyConstraint> getUniqueKeys()


getPrimaryKeyFieldNames

public java.util.Vector getPrimaryKeyFieldNames()


setFields

public void setFields(java.util.Vector fields)


setForeignKeys

public void setForeignKeys(java.util.Vector<ForeignKeyConstraint> foreignKeys)
Set the ForeignKeyConstraint list. If the list contains the same name foreign key constraints, only the first one of that name will be added.


setUniqueKeys

public void setUniqueKeys(java.util.Vector<UniqueKeyConstraint> uniqueKeys)


setCreateSQLFiles

public void setCreateSQLFiles(boolean genFlag)


Copyright © 1998, 2012, Oracle. All Rights Reserved.