public class DatabaseField extends java.lang.Object implements java.lang.Cloneable, java.io.Serializable, CoreField
Purpose: Define a fully qualified field name.
Responsibilities:
DatabaseTable
,
Serialized FormModifier and Type | Field and Description |
---|---|
int |
index
Store normal index of field in result set to optimize performance.
|
boolean |
keepInRow
Indicates whether the field should be kept in the record after the object is created.
|
static int |
NULL_SQL_TYPE
used to represent the value when it has not being defined
|
int |
sqlType
Respective JDBC type of the field's value.
|
java.lang.Class |
type
Respective Java type desired for the field's value, used to optimize performance and for binding.
|
java.lang.String |
typeName |
Constructor and Description |
---|
DatabaseField() |
DatabaseField(java.lang.String qualifiedName) |
DatabaseField(java.lang.String fieldName,
DatabaseTable databaseTable) |
DatabaseField(java.lang.String fieldName,
DatabaseTable databaseTable,
java.lang.String startDelimiter,
java.lang.String endDelimiter) |
DatabaseField(java.lang.String fieldName,
java.lang.String tableName) |
DatabaseField(java.lang.String qualifiedName,
java.lang.String startDelimiter,
java.lang.String endDelimiter) |
Modifier and Type | Method and Description |
---|---|
DatabaseField |
clone()
The table is not cloned because it is treated as an automatic value.
|
void |
convertClassNamesToClasses(java.lang.ClassLoader classLoader) |
boolean |
equals(DatabaseField field)
Determine whether the receiver is equal to a DatabaseField.
|
boolean |
equals(java.lang.Object object)
Determine whether the receiver is equal to a DatabaseField.
|
java.lang.String |
getColumnDefinition()
Get the SQL fragment that is used when generating the DDL for the column.
|
int |
getIndex()
Return the expected index that this field will occur in the result set
row.
|
int |
getLength()
Used to specify the column length when generating DDL.
|
java.lang.String |
getName()
Return the unqualified name of the field.
|
java.lang.String |
getNameDelimited(DatasourcePlatform platform)
Returns this fields name with database delimiters if useDelimiters is true.
|
java.lang.String |
getNameForComparisons()
INTERNAL:
gets the string used for comparisons and in determining the hashcode.
|
int |
getPrecision()
Returns the precision for a decimal column when generating DDL.
|
java.lang.String |
getQualifiedName() |
java.lang.String |
getQualifiedNameDelimited(DatasourcePlatform platform)
Return the qualified name of the field.
|
int |
getScale()
Returns the scale for a decimal column when generating DDL.
|
int |
getSqlType()
Return the JDBC type that corresponds to the field.
|
DatabaseTable |
getTable() |
java.lang.String |
getTableName() |
java.lang.Class |
getType() |
java.lang.String |
getTypeName() |
boolean |
getUseUpperCaseForComparisons() |
int |
hashCode()
Return the hashcode of the name, because it is fairly unique.
|
boolean |
hasTableName() |
void |
initDDLFields()
Inits the DDL generation fields with our defaults.
|
boolean |
isCreatable() |
boolean |
isInsertable()
Used to specify whether the column should be included in SQL UPDATE
statements.
|
boolean |
isNullable()
Used for generating DDL.
|
boolean |
isObjectRelationalDatabaseField()
PUBLIC:
Return if this is an ObjectRelationalDatabaseField.
|
boolean |
isPrimaryKey()
Used to specify whether the column should be included in the primary
on the database table.
|
boolean |
isReadOnly()
Returns true is this database field should be read only.
|
boolean |
isTranslated()
Return true if this database field is a translation.
|
boolean |
isUnique()
Used for generating DDL.
|
boolean |
isUpdatable()
Returns whether the column should be included in SQL INSERT
statements.
|
boolean |
keepInRow() |
void |
resetQualifiedName(java.lang.String qualifiedName)
Reset the field's name and table from the qualified name.
|
void |
setColumnDefinition(java.lang.String columnDefinition)
Set the SQL fragment that is used when generating the DDL for the column.
|
void |
setCreatable(boolean isCreatable) |
void |
setIndex(int index)
Set the expected index that this field will occur in the result set row.
|
void |
setInsertable(boolean isInsertable)
Used to specify whether the column should be included in SQL UPDATE
statements.
|
void |
setIsTranslated(boolean isTranslated)
Set the isTranslated flag.
|
void |
setKeepInRow(boolean keepInRow) |
void |
setLength(int length)
Used to specify the column length when generating DDL.
|
void |
setName(java.lang.String name)
Set the unqualified name of the field.
|
void |
setName(java.lang.String name,
DatasourcePlatform platform)
Set the unqualified name of the field.
|
void |
setName(java.lang.String name,
java.lang.String startDelimiter,
java.lang.String endDelimiter)
Set the unqualified name of the field.
|
void |
setNameForComparisons(java.lang.String name)
INTERNAL:
sets the string to be used for equality checking and determining the hashcode of this field.
|
void |
setNullable(boolean isNullable)
Used for generating DDL.
|
void |
setPrecision(int precision)
Used to specify the precision for a decimal column when generating DDL.
|
void |
setPrimaryKey(boolean isPrimaryKey)
Used to specify whether the column should be included in primary key
on the database table.
|
void |
setScale(int scale)
Used to specify the scale for a decimal column when generating DDL.
|
void |
setSqlType(int sqlType)
Set the JDBC type that corresponds to the field.
|
void |
setTable(DatabaseTable table)
Set the table for the field.
|
void |
setTableName(java.lang.String tableName) |
void |
setType(java.lang.Class type)
Set the Java class type that corresponds to the field.
|
void |
setTypeName(java.lang.String typeName) |
void |
setUnique(boolean isUnique)
Used for generating DDL.
|
void |
setUpdatable(boolean isUpdatable)
Used to specify whether the column should be included in SQL INSERT
statements.
|
void |
setUseDelimiters(boolean useDelimiters) |
boolean |
shouldUseDelimiters() |
java.lang.String |
toString() |
void |
useUpperCaseForComparisons(boolean useUpperCaseForComparisons)
INTERNAL:
Sets the useUpperCaseForComparisons flag which is used to force using the uppercase version of the field's
name to determine field equality and its hashcode, but will still use the original name when writing/printing
operations.
|
public transient java.lang.Class type
public java.lang.String typeName
public int sqlType
public int index
public static final int NULL_SQL_TYPE
public boolean keepInRow
public DatabaseField()
public DatabaseField(java.lang.String qualifiedName)
public DatabaseField(java.lang.String qualifiedName, java.lang.String startDelimiter, java.lang.String endDelimiter)
public DatabaseField(java.lang.String fieldName, java.lang.String tableName)
public DatabaseField(java.lang.String fieldName, DatabaseTable databaseTable)
public DatabaseField(java.lang.String fieldName, DatabaseTable databaseTable, java.lang.String startDelimiter, java.lang.String endDelimiter)
public void initDDLFields()
public DatabaseField clone()
clone
in class java.lang.Object
public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public boolean equals(DatabaseField field)
public java.lang.String getColumnDefinition()
public int getIndex()
public int getLength()
public java.lang.String getName()
public java.lang.String getNameDelimited(DatasourcePlatform platform)
public int getPrecision()
public java.lang.String getQualifiedName()
public java.lang.String getQualifiedNameDelimited(DatasourcePlatform platform)
public int getScale()
public DatabaseTable getTable()
public java.lang.String getTableName()
public void setTableName(java.lang.String tableName)
public java.lang.String getTypeName()
public void setTypeName(java.lang.String typeName)
public int getSqlType()
public int hashCode()
hashCode
in class java.lang.Object
public boolean hasTableName()
public boolean isObjectRelationalDatabaseField()
public boolean isInsertable()
public boolean isNullable()
public boolean isPrimaryKey()
public boolean isTranslated()
public boolean isUnique()
public boolean isReadOnly()
public boolean keepInRow()
public boolean isUpdatable()
public void resetQualifiedName(java.lang.String qualifiedName)
public void setColumnDefinition(java.lang.String columnDefinition)
public void setIndex(int index)
public void setInsertable(boolean isInsertable)
public void setKeepInRow(boolean keepInRow)
public void setIsTranslated(boolean isTranslated)
public void setLength(int length)
public void setName(java.lang.String name)
public void setName(java.lang.String name, DatasourcePlatform platform)
public void setName(java.lang.String name, java.lang.String startDelimiter, java.lang.String endDelimiter)
public void setNullable(boolean isNullable)
public void setPrecision(int precision)
public void setPrimaryKey(boolean isPrimaryKey)
public void setScale(int scale)
public void setSqlType(int sqlType)
public void setTable(DatabaseTable table)
public void setType(java.lang.Class type)
public void setUnique(boolean isUnique)
public void setUpdatable(boolean isUpdatable)
public java.lang.String toString()
toString
in class java.lang.Object
public void setUseDelimiters(boolean useDelimiters)
public boolean shouldUseDelimiters()
public void useUpperCaseForComparisons(boolean useUpperCaseForComparisons)
public boolean getUseUpperCaseForComparisons()
public void setNameForComparisons(java.lang.String name)
public boolean isCreatable()
public void setCreatable(boolean isCreatable)
public java.lang.String getNameForComparisons()
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference