Package org.castor.ddlgen.schemaobject
Class PrimaryKey
java.lang.Object
org.castor.ddlgen.schemaobject.AbstractSchemaObject
org.castor.ddlgen.schemaobject.PrimaryKey
- All Implemented Interfaces:
SchemaObject
- Direct Known Subclasses:
Db2PrimaryKey,DefaultPrimaryKey,HsqlPrimaryKey,MssqlPrimaryKey,PointBasePrimaryKey
Abstract base class for all primary keys.
- 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 -
Method Summary
Modifier and TypeMethodDescriptionfinal voidAdd given field to list of primary key fields.final booleanprotected final voidfieldNames(DDLWriter writer) Concatenate all field names delimited by field delimiter and whitespace.final FieldgetField(int index) Get primary key field at given index.final intGet number of primary key fields.final TablegetTable()Get table the primary key is used for.final inthashCode()final voidSet table the primary key is used for.final voidBuild drop script for the schema object.Methods inherited from class org.castor.ddlgen.schemaobject.AbstractSchemaObject
equals, getConfiguration, getName, setConfiguration, setNameMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.castor.ddlgen.schemaobject.SchemaObject
toCreateDDL
-
Constructor Details
-
PrimaryKey
public PrimaryKey()
-
-
Method Details
-
addField
Add given field to list of primary key fields.- Parameters:
field- Field to add to list of primary key fields.
-
getFieldCount
public final int getFieldCount()Get number of primary key fields.- Returns:
- Number of primary key fields.
-
getField
Get primary key field at given index.- Parameters:
index- Index of primary key field to return.- Returns:
- Primary key field at given index.
-
setTable
Set table the primary key is used for.- Parameters:
table- Table the primary key is used for.
-
getTable
Get table the primary key is used for.- Returns:
- Table the primary key is used for.
-
fieldNames
Concatenate all field names delimited by field delimiter and whitespace.- Parameters:
writer- DDLWriter to write schema objects to.
-
toDropDDL
Build drop script for the schema object.- Parameters:
writer- DDLWriter to write schema objects to.
-
equals
-
hashCode
public final int hashCode()
-