public class FieldDefinition extends Object implements Serializable, 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:
Modifier and Type | Field and Description |
---|---|
protected String |
additional |
protected String |
constraint |
protected org.eclipse.persistence.internal.helper.DatabaseField |
field
DatabaseField stores the field name with case and delimiting information.
|
protected String |
foreignKeyFieldName |
protected boolean |
isIdentity |
protected boolean |
isPrimaryKey |
protected boolean |
isUnique |
protected String |
name |
protected boolean |
shouldAllowNull |
protected int |
size |
protected int |
subSize |
protected Class |
type
Java type class for the field.
|
protected String |
typeDefinition
Database-specific complete type definition like "VARCHAR2(50) UNIQUE NOT NULL".
|
protected String |
typeName
Generic database type name for the field, which can be used instead of the Java class 'type'.
|
Constructor and Description |
---|
FieldDefinition() |
FieldDefinition(String name,
Class type) |
FieldDefinition(String name,
Class type,
int size) |
FieldDefinition(String name,
Class type,
int size,
int subSize) |
FieldDefinition(String name,
String typeName) |
Modifier and Type | Method and Description |
---|---|
void |
appendDBString(Writer writer,
org.eclipse.persistence.internal.sessions.AbstractSession session,
TableDefinition table)
INTERNAL:
Append the database field definition string to the table creation statement.
|
void |
appendTypeString(Writer writer,
org.eclipse.persistence.internal.sessions.AbstractSession session)
INTERNAL:
Append the database field definition string to the type creation statement.
|
Object |
clone()
PUBLIC:
|
String |
getAdditional()
PUBLIC:
Return any additional information about this field to be given when the table is created.
|
String |
getConstraint()
PUBLIC:
Return any constraint of this field.
|
org.eclipse.persistence.internal.helper.DatabaseField |
getDatabaseField()
INTERNAL:
Return the databasefield.
|
String |
getForeignKeyFieldName() |
String |
getName()
PUBLIC:
Return the name of the field.
|
int |
getSize()
PUBLIC:
Return the size of the field, this is only required for some field types.
|
int |
getSubSize()
PUBLIC:
Return the sub-size of the field.
|
Class |
getType()
PUBLIC:
Return the type of the field.
|
String |
getTypeDefinition()
PUBLIC:
Return the type definition of the field.
|
String |
getTypeName()
PUBLIC:
Return the type name of the field.
|
boolean |
isIdentity()
PUBLIC:
Answer whether the receiver is an identity field.
|
boolean |
isPrimaryKey()
PUBLIC:
Answer whether the receiver is a primary key.
|
boolean |
isUnique()
PUBLIC:
Answer whether the receiver is a unique constraint field.
|
void |
setAdditional(String string)
PUBLIC:
Set any additional information about this field to be given when the table is created.
|
void |
setConstraint(String string)
PUBLIC:
Set any constraint of this field.
|
void |
setDatabaseField(org.eclipse.persistence.internal.helper.DatabaseField field)
INTERNAL:
Set the DatabaseField that is associated to this FieldDefinition object.
|
void |
setForeignKeyFieldName(String foreignKeyFieldName) |
void |
setIsIdentity(boolean value)
PUBLIC:
Set whether the receiver is an identity field.
|
void |
setIsPrimaryKey(boolean value)
PUBLIC:
Set whether the receiver is a primary key.
|
void |
setName(String name)
PUBLIC:
Set the name of the field.
|
void |
setShouldAllowNull(boolean value)
PUBLIC:
Set whether the receiver should allow null values.
|
void |
setSize(int size)
PUBLIC:
Set the size of the field, this is only required for some field types.
|
void |
setSubSize(int subSize)
PUBLIC:
Set the sub-size of the field.
|
void |
setType(Class type)
PUBLIC:
Set the type of the field.
|
void |
setTypeDefinition(String typeDefinition)
PUBLIC:
Set the type definition of the field.
|
void |
setTypeName(String typeName)
PUBLIC:
Set the type name of the field.
|
void |
setUnique(boolean value)
PUBLIC:
Set whether the receiver is a unique constraint field.
|
boolean |
shouldAllowNull()
PUBLIC:
Return whether the receiver should allow null values.
|
String |
toString() |
protected String name
protected Class type
protected String typeName
protected org.eclipse.persistence.internal.helper.DatabaseField field
protected String typeDefinition
protected int size
protected int subSize
protected boolean shouldAllowNull
protected boolean isIdentity
protected boolean isPrimaryKey
protected boolean isUnique
protected String additional
protected String constraint
protected String foreignKeyFieldName
public void appendDBString(Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session, TableDefinition table) throws ValidationException
writer
- Target writer where to write field definition string.session
- Current session context.table
- Database table being processed.ValidationException
- When invalid or inconsistent data were found.public void appendTypeString(Writer writer, org.eclipse.persistence.internal.sessions.AbstractSession session) throws ValidationException
writer
- Target writer where to write field definition string.session
- Current session context.ValidationException
- When invalid or inconsistent data were found.public String getAdditional()
public String getConstraint()
public String getForeignKeyFieldName()
public String getName()
public org.eclipse.persistence.internal.helper.DatabaseField getDatabaseField()
public int getSize()
public int getSubSize()
public Class getType()
public String getTypeName()
public String getTypeDefinition()
public boolean isIdentity()
public boolean isPrimaryKey()
public boolean isUnique()
public void setAdditional(String string)
public void setConstraint(String string)
public void setForeignKeyFieldName(String foreignKeyFieldName)
public void setIsIdentity(boolean value)
public void setIsPrimaryKey(boolean value)
public void setName(String name)
public void setDatabaseField(org.eclipse.persistence.internal.helper.DatabaseField field)
public void setShouldAllowNull(boolean value)
public void setSize(int size)
public void setSubSize(int subSize)
public void setType(Class type)
public void setTypeName(String typeName)
public void setTypeDefinition(String typeDefinition)
public void setUnique(boolean value)
public boolean shouldAllowNull()
Copyright © 2007–2021 Eclipse.org - EclipseLink Project. All rights reserved.