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

B32476-03

oracle.toplink.tools.schemaframework
Class FieldDefinition

java.lang.Object
  extended by oracle.toplink.tools.schemaframework.FieldDefinition
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class FieldDefinition
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Purpose: Define a database field definition for creation within a table. This differs from DatabaseField in that it is used only table creation not a runtime.

Responsibilities:

See Also:
Serialized Form

Constructor Summary
FieldDefinition()
           
FieldDefinition(java.lang.String name, java.lang.Class type)
           
FieldDefinition(java.lang.String name, java.lang.Class type, int size)
           
FieldDefinition(java.lang.String name, java.lang.Class type, int size, int subSize)
           
FieldDefinition(java.lang.String name, java.lang.String typeName)
           
 
Method Summary
 java.lang.Object clone()
          
 java.lang.String getAdditional()
          Return any additional information about this field to be given when the table is created.
 java.lang.String getConstraint()
          Return any constraint of this field.
 java.lang.String getForeignKeyFieldName()
           
 java.lang.String getName()
          Return the name of the field.
 int getSize()
          Return the size of the field, this is only required for some field types.
 int getSubSize()
          Return the sub-size of the field.
 java.lang.Class getType()
          Return the type of the field.
 java.lang.String getTypeDefinition()
          Return the type definition of the field.
 java.lang.String getTypeName()
          Return the type name of the field.
 boolean isIdentity()
          Answer whether the receiver is an identity field.
 boolean isPrimaryKey()
          Answer whether the receiver is a primary key.
 boolean isUnique()
          Answer whether the receiver is a unique constraint field.
 void setAdditional(java.lang.String string)
          Set any additional information about this field to be given when the table is created.
 void setConstraint(java.lang.String string)
          Set any constraint of this field.
 void setForeignKeyFieldName(java.lang.String foreignKeyFieldName)
           
 void setIsIdentity(boolean value)
          Set whether the receiver is an identity field.
 void setIsPrimaryKey(boolean value)
          Set whether the receiver is a primary key.
 void setName(java.lang.String name)
          Set the name of the field.
 void setShouldAllowNull(boolean value)
          Set whether the receiver should allow null values.
 void setSize(int size)
          Set the size of the field, this is only required for some field types.
 void setSubSize(int subSize)
          Set the sub-size of the field.
 void setType(java.lang.Class type)
          Set the type of the field.
 void setTypeDefinition(java.lang.String typeDefinition)
          Set the type definition of the field.
 void setTypeName(java.lang.String typeName)
          Set the type name of the field.
 void setUnique(boolean value)
          Set whether the receiver is a unique constraint field.
 boolean shouldAllowNull()
          Return whether the receiver should allow null values.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldDefinition

public FieldDefinition()

FieldDefinition

public FieldDefinition(java.lang.String name,
                       java.lang.Class type)

FieldDefinition

public FieldDefinition(java.lang.String name,
                       java.lang.Class type,
                       int size)

FieldDefinition

public FieldDefinition(java.lang.String name,
                       java.lang.Class type,
                       int size,
                       int subSize)

FieldDefinition

public FieldDefinition(java.lang.String name,
                       java.lang.String typeName)
Method Detail

clone

public java.lang.Object clone()

Overrides:
clone in class java.lang.Object

getAdditional

public java.lang.String getAdditional()
Return any additional information about this field to be given when the table is created.


getConstraint

public java.lang.String getConstraint()
Return any constraint of this field. i.e. "BETWEEN 0 AND 1000000".


getForeignKeyFieldName

public java.lang.String getForeignKeyFieldName()

getName

public java.lang.String getName()
Return the name of the field.


getSize

public int getSize()
Return the size of the field, this is only required for some field types.


getSubSize

public int getSubSize()
Return the sub-size of the field. This is used as the decimal precision for numeric values only.


getType

public java.lang.Class getType()
Return the type of the field. This should be set to a java class, such as String.class, Integer.class or Date.class.


getTypeName

public java.lang.String getTypeName()
Return the type name of the field. This is the generic database type name, which can be used instead of the Java class 'type'. This is translated to a particular database type based on platform.


getTypeDefinition

public java.lang.String getTypeDefinition()
Return the type definition of the field. This is database-specific complete type definition like "VARCHAR2(50) UNIQUE NOT NULL". If this is given, other additional type constraint fields(size, unique, null) are meaningless.


isIdentity

public boolean isIdentity()
Answer whether the receiver is an identity field. Identity fields are Sybase specific, they insure that on insert a unique sequencial value is store in the row.


isPrimaryKey

public boolean isPrimaryKey()
Answer whether the receiver is a primary key. If the table has a multipart primary key this should be set in each field.


isUnique

public boolean isUnique()
Answer whether the receiver is a unique constraint field.


setAdditional

public void setAdditional(java.lang.String string)
Set any additional information about this field to be given when the table is created.


setConstraint

public void setConstraint(java.lang.String string)
Set any constraint of this field. i.e. "BETWEEN 0 AND 1000000".


setForeignKeyFieldName

public void setForeignKeyFieldName(java.lang.String foreignKeyFieldName)

setIsIdentity

public void setIsIdentity(boolean value)
Set whether the receiver is an identity field. Identity fields are Sybase specific, they insure that on insert a unique sequencial value is store in the row.


setIsPrimaryKey

public void setIsPrimaryKey(boolean value)
Set whether the receiver is a primary key. If the table has a multipart primary key this should be set in each field.


setName

public void setName(java.lang.String name)
Set the name of the field.


setShouldAllowNull

public void setShouldAllowNull(boolean value)
Set whether the receiver should allow null values.


setSize

public void setSize(int size)
Set the size of the field, this is only required for some field types.


setSubSize

public void setSubSize(int subSize)
Set the sub-size of the field. This is used as the decimal precision for numeric values only.


setType

public void setType(java.lang.Class type)
Set the type of the field. This should be set to a java class, such as String.class, Integer.class or Date.class.


setTypeName

public void setTypeName(java.lang.String typeName)
Set the type name of the field. This is the generic database type name, which can be used instead of the Java class 'type'. This is translated to a particular database type based on platform.


setTypeDefinition

public void setTypeDefinition(java.lang.String typeDefinition)
Set the type definition of the field. This is database-specific complete type definition like "VARCHAR2(50) UNIQUE NOT NULL". If this is given, other additional type constraint fields(size, unique, null) are meaningless.


setUnique

public void setUnique(boolean value)
Set whether the receiver is a unique constraint field.


shouldAllowNull

public boolean shouldAllowNull()
Return whether the receiver should allow null values.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

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