org.castor.ddlgen.schemaobject
Class Field

java.lang.Object
  extended by org.castor.ddlgen.schemaobject.AbstractSchemaObject
      extended by org.castor.ddlgen.schemaobject.Field
All Implemented Interfaces:
SchemaObject
Direct Known Subclasses:
Db2Field, DefaultField, DerbyField, HsqlField, MssqlField, MysqlField, PointBaseField, PostgresqlField, SybaseField

public abstract class Field
extends AbstractSchemaObject

Abstract base class of all field implementations.

Since:
1.1
Version:
$Revision: 8993 $ $Date: 2011-08-02 01:28:52 +0200 (Di, 02 Aug 2011) $
Author:
Le Duc Bao, Ralf Joachim

Field Summary
 
Fields inherited from class org.castor.ddlgen.schemaobject.AbstractSchemaObject
HASHFACTOR
 
Constructor Summary
Field()
           
 
Method Summary
 boolean equals(java.lang.Object other)
          
 java.lang.Integer getDecimals()
          Get decimals parameter from mapping of sql field.
 KeyGenerator getKeyGenerator()
          Get key generator for this field.
 java.lang.Integer getLength()
          Get length parameter from mapping of sql field.
 java.lang.Integer getPrecision()
          Get precision parameter from mapping of sql field.
 Table getTable()
          Get table which contains this field.
 TypeInfo getType()
          Get type information of this field.
 int hashCode()
          
 boolean isIdentity()
          Get if this field is part of the identity?
 boolean isRequired()
          Get if this field is a required one?
 void merge(Field field)
          Check if given field can be merged with this one.
 void setIdentity(boolean isIdentity)
          Set if this field is part of the identity?
 void setKeyGenerator(KeyGenerator keyGenerator)
          Set key generator for this field.
 void setRequired(boolean isRequired)
          Set if this field is a required one?
 void setTable(Table table)
          Set table which contains this field.
 void setType(TypeInfo type)
          Set type information of this field.
 void toDropDDL(DDLWriter writer)
          Build drop script for the schema object.
 
Methods inherited from class org.castor.ddlgen.schemaobject.AbstractSchemaObject
equals, getConfiguration, getName, setConfiguration, setName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.castor.ddlgen.schemaobject.SchemaObject
toCreateDDL
 

Constructor Detail

Field

public Field()
Method Detail

setKeyGenerator

public final void setKeyGenerator(KeyGenerator keyGenerator)
Set key generator for this field. null if the field has no key generator.

Parameters:
keyGenerator - Key generator for this field.

getKeyGenerator

public final KeyGenerator getKeyGenerator()
Get key generator for this field.

Returns:
Key generator for this field.

setIdentity

public final void setIdentity(boolean isIdentity)
Set if this field is part of the identity?

Parameters:
isIdentity - true if the field is part of the identity, true otherwise.

isIdentity

public final boolean isIdentity()
Get if this field is part of the identity?

Returns:
true if the field is part of the identity, true otherwise.

setRequired

public final void setRequired(boolean isRequired)
Set if this field is a required one?

Parameters:
isRequired - true if the field is required, true otherwise.

isRequired

public final boolean isRequired()
Get if this field is a required one?

Returns:
true if the field is required, true otherwise.

setType

public final void setType(TypeInfo type)
Set type information of this field.

Parameters:
type - Type information of this field.

getType

public final TypeInfo getType()
Get type information of this field.

Returns:
Type information of this field.

setTable

public final void setTable(Table table)
Set table which contains this field.

Parameters:
table - Table which contains this field.

getTable

public final Table getTable()
Get table which contains this field.

Returns:
Table which contains this field.

getLength

public final java.lang.Integer getLength()
Get length parameter from mapping of sql field.
Returns null as it is not supported yet.

Returns:
length Length parameter from mapping of sql field.

getPrecision

public final java.lang.Integer getPrecision()
Get precision parameter from mapping of sql field.
Returns null as it is not supported yet.

Returns:
precision Precision parameter from mapping of sql field.

getDecimals

public final java.lang.Integer getDecimals()
Get decimals parameter from mapping of sql field.
Returns null as it is not supported yet.

Returns:
decimals Decimals parameter from mapping of sql field.

toDropDDL

public final void toDropDDL(DDLWriter writer)
Build drop script for the schema object.

Parameters:
writer - DDLWriter to write schema objects to.

merge

public final void merge(Field field)
                 throws GeneratorException
Check if given field can be merged with this one.

Parameters:
field - Field to check if it is able to be merged.
Throws:
GeneratorException - If fields cannot be merged.

equals

public final boolean equals(java.lang.Object other)

Overrides:
equals in class java.lang.Object

hashCode

public final int hashCode()

Overrides:
hashCode in class java.lang.Object


Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com