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 | |
| protected String | |
| protected DatabaseField | field
DatabaseField stores the field name with case and delimiting information. |
| protected String | |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| protected String | |
| protected boolean | |
| protected int | |
| protected int | |
| 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'. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | appendDBString(final Writer
Target writer where to write field definition string. writer, final AbstractSession Current session context. session, final TableDefinition Database table being processed. table)INTERNAL: Append the database field definition string to the table creation statement. |
| public void | appendTypeString(final Writer
Target writer where to write field definition string. writer, final AbstractSession Current session context. session)INTERNAL: Append the database field definition string to the type creation statement. |
| public Object | |
| public String | getAdditional()
PUBLIC: Return any additional information about this field to be given when the table is created. |
| public String | |
| public DatabaseField | |
| public String | |
| public String | |
| public int | |
| public int | |
| public Class | |
| public String | |
| public String | |
| public boolean | |
| public boolean | |
| public boolean | |
| public void | setAdditional(String string)
PUBLIC: Set any additional information about this field to be given when the table is created. |
| public void | |
| public void | setDatabaseField(DatabaseField field)
INTERNAL: Set the DatabaseField that is associated to this FieldDefinition object. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public boolean | |
| public String |
| additional | back to summary |
|---|---|
| protected String additional | |
| constraint | back to summary |
|---|---|
| protected String constraint | |
| field | back to summary |
|---|---|
| protected DatabaseField field DatabaseField stores the field name with case and delimiting information. Used if the field needs to be found in the table metadata, for extending tables. if null, name is used for comparison to determine if this field already exists. | |
| foreignKeyFieldName | back to summary |
|---|---|
| protected String foreignKeyFieldName | |
| isIdentity | back to summary |
|---|---|
| protected boolean isIdentity | |
| isPrimaryKey | back to summary |
|---|---|
| protected boolean isPrimaryKey | |
| isUnique | back to summary |
|---|---|
| protected boolean isUnique | |
| name | back to summary |
|---|---|
| protected String name | |
| shouldAllowNull | back to summary |
|---|---|
| protected boolean shouldAllowNull | |
| size | back to summary |
|---|---|
| protected int size | |
| subSize | back to summary |
|---|---|
| protected int subSize | |
| type | back to summary |
|---|---|
| protected Class<?> type Java type class for the field. Particular database type is generated based on platform from this. | |
| typeDefinition | back to summary |
|---|---|
| protected String typeDefinition 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. | |
| typeName | back to summary |
|---|---|
| protected String typeName Generic database type name for the field, which can be used instead of the Java class 'type'. This is translated to a particular database type based on platform. | |
| FieldDefinition | back to summary |
|---|---|
| public FieldDefinition() | |
| FieldDefinition | back to summary |
|---|---|
| public FieldDefinition(String name, Class<?> type) | |
| FieldDefinition | back to summary |
|---|---|
| public FieldDefinition(String name, Class<?> type, int size) | |
| FieldDefinition | back to summary |
|---|---|
| public FieldDefinition(String name, Class<?> type, int size, int subSize) | |
| FieldDefinition | back to summary |
|---|---|
| public FieldDefinition(String name, String typeName) | |
| appendDBString | back to summary |
|---|---|
| public void appendDBString(final Writer writer, final AbstractSession session, final TableDefinition table) throws ValidationException INTERNAL: Append the database field definition string to the table creation statement.
| |
| appendTypeString | back to summary |
|---|---|
| public void appendTypeString(final Writer writer, final AbstractSession session) throws ValidationException INTERNAL: Append the database field definition string to the type creation statement. Types do not support constraints.
| |
| clone | back to summary |
|---|---|
| public Object clone() Overrides java. PUBLIC:
| |
| getAdditional | back to summary |
|---|---|
| public String getAdditional() PUBLIC: Return any additional information about this field to be given when the table is created. | |
| getConstraint | back to summary |
|---|---|
| public String getConstraint() PUBLIC: Return any constraint of this field. i.e. "BETWEEN 0 AND 1000000". | |
| getDatabaseField | back to summary |
|---|---|
| public DatabaseField getDatabaseField() INTERNAL: Return the databasefield. | |
| getForeignKeyFieldName | back to summary |
|---|---|
| public String getForeignKeyFieldName() | |
| getName | back to summary |
|---|---|
| public String getName() PUBLIC: Return the name of the field. | |
| getSize | back to summary |
|---|---|
| public int getSize() PUBLIC: Return the size of the field, this is only required for some field types. | |
| getSubSize | back to summary |
|---|---|
| public int getSubSize() PUBLIC: Return the sub-size of the field. This is used as the decimal precision for numeric values only. | |
| getType | back to summary |
|---|---|
| public Class PUBLIC: Return the type of the field. This should be set to a java class, such as String.class, Integer.class or Date.class. | |
| getTypeDefinition | back to summary |
|---|---|
| public String getTypeDefinition() PUBLIC: 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. | |
| getTypeName | back to summary |
|---|---|
| public String getTypeName() PUBLIC: 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. | |
| isIdentity | back to summary |
|---|---|
| public boolean isIdentity() PUBLIC: Answer whether the receiver is an identity field. Identity fields are Sybase specific, they insure that on insert a unique sequential value is stored in the row. | |
| isPrimaryKey | back to summary |
|---|---|
| public boolean isPrimaryKey() PUBLIC: Answer whether the receiver is a primary key. If the table has a multipart primary key this should be set in each field. | |
| isUnique | back to summary |
|---|---|
| public boolean isUnique() PUBLIC: Answer whether the receiver is a unique constraint field. | |
| setAdditional | back to summary |
|---|---|
| public void setAdditional(String string) PUBLIC: Set any additional information about this field to be given when the table is created. | |
| setConstraint | back to summary |
|---|---|
| public void setConstraint(String string) PUBLIC: Set any constraint of this field. i.e. "BETWEEN 0 AND 1000000". | |
| setDatabaseField | back to summary |
|---|---|
| public void setDatabaseField(DatabaseField field) INTERNAL: Set the DatabaseField that is associated to this FieldDefinition object. The databaesField is used when extending tables to see if this field already exists. | |
| setForeignKeyFieldName | back to summary |
|---|---|
| public void setForeignKeyFieldName(String foreignKeyFieldName) | |
| setIsIdentity | back to summary |
|---|---|
| public void setIsIdentity(boolean value) PUBLIC: Set whether the receiver is an identity field. Identity fields are Sybase specific, they insure that on insert a unique sequential value is stored in the row. | |
| setIsPrimaryKey | back to summary |
|---|---|
| public void setIsPrimaryKey(boolean value) PUBLIC: Set whether the receiver is a primary key. If the table has a multipart primary key this should be set in each field. | |
| setName | back to summary |
|---|---|
| public void setName(String name) PUBLIC: Set the name of the field. | |
| setShouldAllowNull | back to summary |
|---|---|
| public void setShouldAllowNull(boolean value) PUBLIC: Set whether the receiver should allow null values. | |
| setSize | back to summary |
|---|---|
| public void setSize(int size) PUBLIC: Set the size of the field, this is only required for some field types. | |
| setSubSize | back to summary |
|---|---|
| public void setSubSize(int subSize) PUBLIC: Set the sub-size of the field. This is used as the decimal precision for numeric values only. | |
| setType | back to summary |
|---|---|
| public void setType(Class<?> type) PUBLIC: Set the type of the field. This should be set to a java class, such as String.class, Integer.class or Date.class. | |
| setTypeDefinition | back to summary |
|---|---|
| public void setTypeDefinition(String typeDefinition) PUBLIC: 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. | |
| setTypeName | back to summary |
|---|---|
| public void setTypeName(String typeName) PUBLIC: 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. | |
| setUnique | back to summary |
|---|---|
| public void setUnique(boolean value) PUBLIC: Set whether the receiver is a unique constraint field. | |
| shouldAllowNull | back to summary |
|---|---|
| public boolean shouldAllowNull() PUBLIC: Return whether the receiver should allow null values. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |