Purpose: Define a fully qualified field name.
Responsibilities:
DatabaseTable
| Modifier and Type | Field and Description |
|---|---|
| protected String | |
| public int | index
Store normal index of field in result set to optimize performance. |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| protected boolean | |
| protected boolean | isTranslated
Returns true if this field was translated. |
| protected boolean | |
| protected boolean | |
| public boolean | keepInRow
Indicates whether the field should be kept in the record after the object is created. |
| protected int | |
| protected String | name
Column name of the field. |
| protected String | nameForComparisons
If this is set, it will be used in determining equality (unless delimiters are used) and the hashcode. |
| public static final int | NULL_SQL_TYPE
used to represent the value when it has not being defined |
| protected int | |
| protected String | qualifiedName
PERF: Cache fully qualified table.field-name. |
| protected int | scale
Variables used for generating DDL |
| public int | sqlType
Respective JDBC type of the field's value. |
| protected DatabaseTable | table
Fields table (encapsulates name + creator). |
| public transient Class | type
Respective Java type desired for the field's value, used to optimize performance and for binding. |
| public String | |
| protected boolean | |
| protected boolean | useUpperCaseForComparisons
setting to true will cause getNameForComparisons to lazy initialize nameForComparisons using the value from getName().toUpperCase(). |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | |
| public | |
| public | |
| public | DatabaseField(String fieldName, DatabaseTable databaseTable, String startDelimiter, String endDelimiter)
|
| Modifier and Type | Method and Description |
|---|---|
| public DatabaseField | clone()
Overrides java. |
| public void | |
| public boolean | equals(Object
the reference object with which to compare. object)Overrides java. |
| public boolean | |
| public String | |
| public int | |
| public int | |
| public String | getName()
Implements org. |
| public String | getNameDelimited(DatasourcePlatform platform)
Returns this fields name with database delimiters if useDelimiters is true. |
| public String | getNameForComparisons()
INTERNAL: gets the string used for comparisons and in determining the hashcode. |
| public int | |
| public String | |
| public String | |
| public int | |
| public int | |
| public DatabaseTable | |
| public String | |
| public Class | |
| public String | |
| public boolean | |
| public int | hashCode()
Overrides java. |
| public boolean | |
| public void | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | isPrimaryKey()
Used to specify whether the column should be included in the primary on the database table. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public void | |
| public void | setColumnDefinition(String columnDefinition)
Set the SQL fragment that is used when generating the DDL for the column. |
| public void | |
| public void | |
| public void | setInsertable(boolean isInsertable)
Used to specify whether the column should be included in SQL UPDATE statements. |
| public void | |
| public void | |
| public void | |
| public void | setName(String name)
Implements org. |
| public void | |
| public void | |
| public void | setNameForComparisons(String name)
INTERNAL: sets the string to be used for equality checking and determining the hashcode of this field. |
| public void | |
| public void | |
| public void | setPrimaryKey(boolean isPrimaryKey)
Used to specify whether the column should be included in primary key on the database table. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | setType(Class<?> type)
Implements org. |
| public void | |
| public void | |
| public void | setUpdatable(boolean isUpdatable)
Used to specify whether the column should be included in SQL INSERT statements. |
| public void | |
| public boolean | |
| public String | |
| public 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. |
| columnDefinition | back to summary |
|---|---|
| protected String columnDefinition | |
| index | back to summary |
|---|---|
| public int index Store normal index of field in result set to optimize performance. PERF: Allow direct variable access from getIndicatingNoEntry. | |
| isCreatable | back to summary |
|---|---|
| protected boolean isCreatable | |
| isInsertable | back to summary |
|---|---|
| protected boolean isInsertable | |
| isNullable | back to summary |
|---|---|
| protected boolean isNullable | |
| isPrimaryKey | back to summary |
|---|---|
| protected boolean isPrimaryKey | |
| isTranslated | back to summary |
|---|---|
| protected boolean isTranslated Returns true if this field was translated. | |
| isUnique | back to summary |
|---|---|
| protected boolean isUnique | |
| isUpdatable | back to summary |
|---|---|
| protected boolean isUpdatable | |
| keepInRow | back to summary |
|---|---|
| public boolean keepInRow Indicates whether the field should be kept in the record after the object is created. Used by ObjectLevelReadQuery ResultSetAccessOptimization. | |
| length | back to summary |
|---|---|
| protected int length | |
| name | back to summary |
|---|---|
| protected String name Column name of the field. | |
| nameForComparisons | back to summary |
|---|---|
| protected String nameForComparisons If this is set, it will be used in determining equality (unless delimiters are used) and the hashcode.
| |
| NULL_SQL_TYPE | back to summary |
|---|---|
| public static final int NULL_SQL_TYPE used to represent the value when it has not being defined | |
| precision | back to summary |
|---|---|
| protected int precision | |
| qualifiedName | back to summary |
|---|---|
| protected String qualifiedName PERF: Cache fully qualified table.field-name. | |
| scale | back to summary |
|---|---|
| protected int scale Variables used for generating DDL | |
| sqlType | back to summary |
|---|---|
| public int sqlType Respective JDBC type of the field's value. This overrides the class type, which the JDBC type is normally computed from. PERF: Allow direct variable access from getObject. | |
| table | back to summary |
|---|---|
| protected DatabaseTable table Fields table (encapsulates name + creator). | |
| type | back to summary |
|---|---|
| public transient Class<?> type Respective Java type desired for the field's value, used to optimize performance and for binding. PERF: Allow direct variable access from getObject. | |
| typeName | back to summary |
|---|---|
| public String typeName | |
| useDelimiters | back to summary |
|---|---|
| protected boolean useDelimiters | |
| useUpperCaseForComparisons | back to summary |
|---|---|
| protected boolean useUpperCaseForComparisons setting to true will cause getNameForComparisons to lazy initialize nameForComparisons using the value from getName().toUpperCase(). | |
| DatabaseField | back to summary |
|---|---|
| public DatabaseField() | |
| DatabaseField | back to summary |
|---|---|
| public DatabaseField(String qualifiedName) | |
| DatabaseField | back to summary |
|---|---|
| public DatabaseField(String qualifiedName, String startDelimiter, String endDelimiter) | |
| DatabaseField | back to summary |
|---|---|
| public DatabaseField(String fieldName, String tableName) | |
| DatabaseField | back to summary |
|---|---|
| public DatabaseField(String fieldName, DatabaseTable databaseTable) | |
| DatabaseField | back to summary |
|---|---|
| public DatabaseField(String fieldName, DatabaseTable databaseTable, String startDelimiter, String endDelimiter) | |
| clone | back to summary |
|---|---|
| public DatabaseField clone() Overrides java. The table is not cloned because it is treated as an automatic value.
| |
| convertClassNamesToClasses | back to summary |
|---|---|
| public void convertClassNamesToClasses(ClassLoader classLoader) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides java. Determine whether the receiver is equal to a DatabaseField. Return true if the receiver and field have the same name and table. Also return true if the table of the receiver or field are unspecified, ie. have no name.
| |
| equals | back to summary |
|---|---|
| public boolean equals(DatabaseField field) Determine whether the receiver is equal to a DatabaseField. Return true if the receiver and field have the same name and table. Also return true if the table of the receiver or field are unspecified, ie. have no name. | |
| getColumnDefinition | back to summary |
|---|---|
| public String getColumnDefinition() Get the SQL fragment that is used when generating the DDL for the column. | |
| getIndex | back to summary |
|---|---|
| public int getIndex() Return the expected index that this field will occur in the result set row. This is used to optimize performance of database row field lookups. | |
| getLength | back to summary |
|---|---|
| public int getLength() Used to specify the column length when generating DDL. | |
| getName | back to summary |
|---|---|
| public String getName() Implements org. Return the unqualified name of the field.
| |
| getNameDelimited | back to summary |
|---|---|
| public String getNameDelimited(DatasourcePlatform platform) Returns this fields name with database delimiters if useDelimiters is true. This method should be called any time the field name is requested for writing SQL. | |
| getNameForComparisons | back to summary |
|---|---|
| public String getNameForComparisons() INTERNAL: gets the string used for comparisons and in determining the hashcode. | |
| getPrecision | back to summary |
|---|---|
| public int getPrecision() Returns the precision for a decimal column when generating DDL. | |
| getQualifiedName | back to summary |
|---|---|
| public String getQualifiedName() | |
| getQualifiedNameDelimited | back to summary |
|---|---|
| public String getQualifiedNameDelimited(DatasourcePlatform platform) Return the qualified name of the field. PERF: Cache the qualified name. | |
| getScale | back to summary |
|---|---|
| public int getScale() Returns the scale for a decimal column when generating DDL. | |
| getSqlType | back to summary |
|---|---|
| public int getSqlType() Return the JDBC type that corresponds to the field. The JDBC type is normally determined from the class type, but this allows it to be overridden for types that do not match directly to a Java type, such as MONEY or ARRAY, STRUCT, XMLTYPE, etc. This can be used for binding or stored procedure usage. | |
| getTable | back to summary |
|---|---|
| public DatabaseTable getTable() | |
| getTableName | back to summary |
|---|---|
| public String getTableName() | |
| getType | back to summary |
|---|---|
| public Class Implements org.
| |
| getTypeName | back to summary |
|---|---|
| public String getTypeName() | |
| getUseUpperCaseForComparisons | back to summary |
|---|---|
| public boolean getUseUpperCaseForComparisons() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Return the hashcode of the name, because it is fairly unique.
| |
| hasTableName | back to summary |
|---|---|
| public boolean hasTableName() | |
| initDDLFields | back to summary |
|---|---|
| public void initDDLFields() Inits the DDL generation fields with our defaults. Note we used to initialize the length to the JPA default of 255 but since this default value should only apply for string fields we set it to 0 to indicate that it was not specified and rely on the default (255) to come from individual platforms. | |
| isCreatable | back to summary |
|---|---|
| public boolean isCreatable() | |
| isInsertable | back to summary |
|---|---|
| public boolean isInsertable() Used to specify whether the column should be included in SQL UPDATE statements. | |
| isNullable | back to summary |
|---|---|
| public boolean isNullable() Used for generating DDL. Returns true if the database column is nullable. | |
| isObjectRelationalDatabaseField | back to summary |
|---|---|
| public boolean isObjectRelationalDatabaseField() PUBLIC: Return if this is an ObjectRelationalDatabaseField. | |
| isPrimaryKey | back to summary |
|---|---|
| public boolean isPrimaryKey() Used to specify whether the column should be included in the primary on the database table. | |
| isReadOnly | back to summary |
|---|---|
| public boolean isReadOnly() Returns true is this database field should be read only. | |
| isTranslated | back to summary |
|---|---|
| public boolean isTranslated() Return true if this database field is a translation. | |
| isUnique | back to summary |
|---|---|
| public boolean isUnique() Used for generating DDL. Returns true if the field is a unique key. | |
| isUpdatable | back to summary |
|---|---|
| public boolean isUpdatable() Returns whether the column should be included in SQL INSERT statements. | |
| keepInRow | back to summary |
|---|---|
| public boolean keepInRow() | |
| resetQualifiedName | back to summary |
|---|---|
| public void resetQualifiedName(String qualifiedName) Reset the field's name and table from the qualified name. | |
| setColumnDefinition | back to summary |
|---|---|
| public void setColumnDefinition(String columnDefinition) Set the SQL fragment that is used when generating the DDL for the column. | |
| setCreatable | back to summary |
|---|---|
| public void setCreatable(boolean isCreatable) | |
| setIndex | back to summary |
|---|---|
| public void setIndex(int index) Set the expected index that this field will occur in the result set row. This is used to optimize performance of database row field lookups. | |
| setInsertable | back to summary |
|---|---|
| public void setInsertable(boolean isInsertable) Used to specify whether the column should be included in SQL UPDATE statements. | |
| setIsTranslated | back to summary |
|---|---|
| public void setIsTranslated(boolean isTranslated) Set the isTranslated flag. | |
| setKeepInRow | back to summary |
|---|---|
| public void setKeepInRow(boolean keepInRow) | |
| setLength | back to summary |
|---|---|
| public void setLength(int length) Used to specify the column length when generating DDL. | |
| setName | back to summary |
|---|---|
| public void setName(String name) Implements org. Set the unqualified name of the field.
| |
| setName | back to summary |
|---|---|
| public void setName(String name, DatasourcePlatform platform) Set the unqualified name of the field. If the name contains database delimiters, they will be stripped and a flag will be set to have them added when the DatabaseField is written to SQL | |
| setName | back to summary |
|---|---|
| public void setName(String name, String startDelimiter, String endDelimiter) Set the unqualified name of the field. If the name contains database delimiters, they will be stripped and a flag will be set to have them added when the DatabaseField is written to SQL | |
| setNameForComparisons | back to summary |
|---|---|
| public void setNameForComparisons(String name) INTERNAL: sets the string to be used for equality checking and determining the hashcode of this field. This will overwrite the useUpperCaseForEquality setting with the passed in string. | |
| setNullable | back to summary |
|---|---|
| public void setNullable(boolean isNullable) Used for generating DDL. Set to true if the database column is nullable. | |
| setPrecision | back to summary |
|---|---|
| public void setPrecision(int precision) Used to specify the precision for a decimal column when generating DDL. | |
| setPrimaryKey | back to summary |
|---|---|
| public void setPrimaryKey(boolean isPrimaryKey) Used to specify whether the column should be included in primary key on the database table. | |
| setScale | back to summary |
|---|---|
| public void setScale(int scale) Used to specify the scale for a decimal column when generating DDL. | |
| setSqlType | back to summary |
|---|---|
| public void setSqlType(int sqlType) Set the JDBC type that corresponds to the field. The JDBC type is normally determined from the class type, but this allows it to be overridden for types that do not match directly to a Java type, such as MONEY or ARRAY, STRUCT, XMLTYPE, etc. This can be used for binding or stored procedure usage. | |
| setTable | back to summary |
|---|---|
| public void setTable(DatabaseTable table) Set the table for the field. | |
| setTableName | back to summary |
|---|---|
| public void setTableName(String tableName) | |
| setType | back to summary |
|---|---|
| public void setType(Class<?> type) Implements org. Set the Java class type that corresponds to the field. The JDBC type is determined from the class type, this is used to optimize performance, and for binding.
| |
| setTypeName | back to summary |
|---|---|
| public void setTypeName(String typeName) | |
| setUnique | back to summary |
|---|---|
| public void setUnique(boolean isUnique) Used for generating DDL. Set to true if the field is a unique key. | |
| setUpdatable | back to summary |
|---|---|
| public void setUpdatable(boolean isUpdatable) Used to specify whether the column should be included in SQL INSERT statements. | |
| setUseDelimiters | back to summary |
|---|---|
| public void setUseDelimiters(boolean useDelimiters) | |
| shouldUseDelimiters | back to summary |
|---|---|
| public boolean shouldUseDelimiters() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| useUpperCaseForComparisons | back to summary |
|---|---|
| public 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. If this isn't a change, it is ignored, otherwise it sets the nameForComparisons to null. | |