Methods Summary |
---|
public java.lang.Object | clone()The table is not cloned because it is treated as an automic value.
try {
return super.clone();
} catch (CloneNotSupportedException exception) {
}
return null;
|
public boolean | equals(oracle.toplink.essentials.internal.helper.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 unspecfied,
ie. have no name.
if (this == field) {
return true;
}
if (field != null) {
if (DatabasePlatform.shouldIgnoreCaseOnFieldComparisons()) {
if (getName().equalsIgnoreCase(field.getName())) {
if ((getTableName().length() == 0) || (field.getTableName().length() == 0)) {
return true;
}
return (getTable().equals(field.getTable()));
}
} else {
if (getName().equals(field.getName())) {
if ((getTableName().length() == 0) || (field.getTableName().length() == 0)) {
return true;
}
return (getTable().equals(field.getTable()));
}
}
}
return false;
|
public boolean | equals(java.lang.Object object)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 unspecfied,
ie. have no name.
if (!(object instanceof DatabaseField)) {
return false;
}
return equals((DatabaseField)object);
|
public java.lang.String | getColumnDefinition()Get the SQL fragment that is used when generating the DDL for the column.
return this.columnDefinition;
|
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.
return index;
|
public int | getLength()Used to specify the column length when generating DDL.
return this.length;
|
public java.lang.String | getName()Return the unqualified name of the field.
return name;
|
public int | getPrecision()Returns the precision for a decimal column when generating DDL.
return this.precision;
|
public java.lang.String | getQualifiedName()Return the qualified name of the field.
if (hasTableName()) {
return getTable().getQualifiedName() + "." + getName();
} else {
return getName();
}
|
public int | getScale()Returns the scale for a decimal column when generating DDL.
return this.scale;
|
public int | getSqlType()Return the JDBC type that coresponds to the field.
The JDBC type is normally determined from the class type,
but this allows it to be overriden 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.
return sqlType;
|
public oracle.toplink.essentials.internal.helper.DatabaseTable | getTable()
return table;
|
public java.lang.String | getTableName()
return getTable().getName();
|
public java.lang.Class | getType()
return type;
|
public boolean | hasTableName()
if (getTable() == null) {
return false;
}
if (getTable().getName() == null) {
return false;
}
return !(getTable().getName().equals(""));
|
public int | hashCode()Return the hashcode of the name, because it is fairly unqiue.
return getName().hashCode();
|
public void | initDDLFields()Inits the DDL generation fields. Currently equivalent to the defaults
from the EJB 3.0 spec.
scale = 0;
length = 255;
precision = 0;
isUnique = false;
isNullable = true;
isUpdatable = true;
isInsertable = true;
columnDefinition = "";
|
public boolean | isInsertable()Used to specify whether the column should be included in SQL UPDATE
statements.
return this.isInsertable;
|
public boolean | isNullable()Used for generatating DDL. Returns true if the database column is
nullable.
return this.isNullable;
|
public boolean | isReadOnly()Returns true is this database field should be read only.
return (! isUpdatable && ! isInsertable);
|
public boolean | isUnique()Used for generatating DDL. Returns true if the field is a unique key.
return this.isUnique;
|
public boolean | isUpdatable()Returns whether the column should be included in SQL INSERT
statements.
return this.isUpdatable;
|
public void | resetQualifiedName(java.lang.String qualifiedName)Reset the field's name and table from the qualified name.
setIndex(-1);
int index = qualifiedName.lastIndexOf('.");
if (index == -1) {
setName(qualifiedName);
getTable().setName("");
getTable().setTableQualifier("");
} else {
setName(qualifiedName.substring(index + 1, qualifiedName.length()));
getTable().setPossiblyQualifiedName(qualifiedName.substring(0, index));
}
|
public void | setColumnDefinition(java.lang.String columnDefinition)Set the SQL fragment that is used when generating the DDL for the column.
this.columnDefinition = columnDefinition;
|
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.
this.index = index;
|
public void | setInsertable(boolean isInsertable)Used to specify whether the column should be included in SQL UPDATE
statements.
this.isInsertable = isInsertable;
|
public void | setLength(int length)Used to specify the column length when generating DDL.
this.length = length;
|
public void | setName(java.lang.String name)Set the unqualified name of the field.
this.name = name;
|
public void | setNullable(boolean isNullable)Used for generatating DDL. Set to true if the database column is
nullable.
this.isNullable = isNullable;
|
public void | setPrecision(int precision)Used to specify the precision for a decimal column when generating DDL.
this.precision = precision;
|
public void | setScale(int scale)Used to specify the scale for a decimal column when generating DDL.
this.scale = scale;
|
public void | setSqlType(int sqlType)Set the JDBC type that coresponds to the field.
The JDBC type is normally determined from the class type,
but this allows it to be overriden 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.
this.sqlType = sqlType;
|
public void | setTable(oracle.toplink.essentials.internal.helper.DatabaseTable table)Set the table for the field.
this.table = table;
|
public void | setTableName(java.lang.String tableName)Set the table name for this field.
setTable(new DatabaseTable(tableName));
|
public void | setType(java.lang.Class type)Set the Java class type that coresponds to the field.
The JDBC type is determined from the class type,
this is used to optimize performance, and for binding.
this.type = type;
|
public void | setUnique(boolean isUnique)Used for generatating DDL. Set to true if the field is a unique key.
this.isUnique = isUnique;
|
public void | setUpdatable(boolean isUpdatable)Used to specify whether the column should be included in SQL INSERT
statements.
this.isUpdatable = isUpdatable;
|
public java.lang.String | toString()
return this.getQualifiedName();
|