Package org.castor.ddlgen.schemaobject
Class Field
- java.lang.Object
-
- org.castor.ddlgen.schemaobject.AbstractSchemaObject
-
- 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: 5951 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
- Author:
- Le Duc Bao, Ralf Joachim
-
-
Field Summary
-
Fields inherited from class org.castor.ddlgen.schemaobject.AbstractSchemaObject
HASHFACTOR
-
-
Constructor Summary
Constructors Constructor Description Field()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object other)java.lang.IntegergetDecimals()Get decimals parameter from mapping of sql field.KeyGeneratorgetKeyGenerator()Get key generator for this field.java.lang.IntegergetLength()Get length parameter from mapping of sql field.java.lang.IntegergetPrecision()Get precision parameter from mapping of sql field.TablegetTable()Get table which contains this field.TypeInfogetType()Get type information of this field.inthashCode()booleanisIdentity()Get if this field is part of the identity?booleanisRequired()Get if this field is a required one?voidmerge(Field field)Check if given field can be merged with this one.voidsetIdentity(boolean isIdentity)Set if this field is part of the identity?voidsetKeyGenerator(KeyGenerator keyGenerator)Set key generator for this field.voidsetRequired(boolean isRequired)Set if this field is a required one?voidsetTable(Table table)Set table which contains this field.voidsetType(TypeInfo type)Set type information of this field.voidtoDropDDL(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
-
-
-
-
Method Detail
-
setKeyGenerator
public final void setKeyGenerator(KeyGenerator keyGenerator)
Set key generator for this field.nullif 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-trueif the field is part of the identity,trueotherwise.
-
isIdentity
public final boolean isIdentity()
Get if this field is part of the identity?- Returns:
trueif the field is part of the identity,trueotherwise.
-
setRequired
public final void setRequired(boolean isRequired)
Set if this field is a required one?- Parameters:
isRequired-trueif the field is required,trueotherwise.
-
isRequired
public final boolean isRequired()
Get if this field is a required one?- Returns:
trueif the field is required,trueotherwise.
-
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.
Returnsnullas 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.
Returnsnullas 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.
Returnsnullas 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:
equalsin classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-