T - The type of the Columnpublic abstract class Column<T> extends Object implements FieldAttributes<T>
Table column which is extended by the generated classes.| Modifier and Type | Class and Description |
|---|---|
static class |
Column.LoadException
Thrown when any unforeseen problem arises loading a
Column. |
static class |
Column.SettingException
Thrown when any unforseen problem arises setting the value
of a
Column. |
| Constructor and Description |
|---|
Column(Table<?> table,
String name,
SQLPoemType<T> type,
DefinitionSource definitionSource)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Field<T> |
asEmptyField()
Return a Field of the same type as this Column with default attributes.
|
abstract Field<T> |
asField(Persistent g)
Return a Field of the same type as this Column from the Persistent.
|
CachedSelection |
cachedSelectionWhereEq(Object raw)
Create a new CachedSelection of objects equal to this raw parameter.
|
void |
dump()
Print information about the structure of the Column to stdout.
|
void |
dump(PrintStream ps)
Print information to PrintStream.
|
Persistent |
ensure(Persistent orCreate)
Ensures a row exists for which this column matches when compared with
the given
Persistent. |
String |
eqClause(Object raw) |
int |
firstFree(String whereClause)
Find the next free value in an Integer column.
|
Persistent |
firstWhereEq(Object raw)
Return the first one found or null if not found.
|
String |
fullQuotedName() |
ColumnInfo |
getColumnInfo() |
abstract Object |
getCooked(Persistent g)
Retrieves the field value, with locking and access control
for this
Column. |
Database |
getDatabase() |
String |
getDescription() |
DisplayLevel |
getDisplayLevel() |
String |
getDisplayName()
Return a human readable name from the metadata.
|
Integer |
getDisplayOrderPriority() |
int |
getHeight() |
boolean |
getIndexed() |
IntegrityFix |
getIntegrityFix() |
String |
getName() |
abstract Object |
getRaw_unsafe(Persistent g)
Retrieves the field value, without locking,
for this
Column. |
abstract Object |
getRaw(Persistent g)
Retrieves the field value, with locking,
for this
Column. |
String |
getRenderInfo() |
Searchability |
getSearchability() |
boolean |
getSortDescending()
Defaults to false.
|
SQLPoemType<T> |
getSQLType() |
Table<Persistent> |
getTable() |
PoemType<T> |
getType() |
boolean |
getUnique() |
boolean |
getUserCreateable() |
boolean |
getUserEditable() |
int |
getWidth() |
boolean |
isDeletedColumn()
A Deleted Column is a Column which signal whether
the record has been soft-deleted.
|
boolean |
isTroidColumn() |
String |
quotedName() |
Enumeration<Persistent> |
referencesTo(Persistent object)
Return an Enumeration of
Persistents from the
Table this column refers to, if this is a reference column,
otherwise the Empty Enumeration. |
Enumeration<Persistent> |
selectionWhereEq(Object raw)
Get rows where column equal to value.
|
abstract void |
setCooked(Persistent g,
Object cooked)
Sets the field value, with locking, access control
and validation for this
Column. |
void |
setDisplayLevel(DisplayLevel level) |
void |
setIntegrityFix(StandardIntegrityFix fix) |
abstract void |
setRaw_unsafe(Persistent g,
Object raw)
Sets the field value, without locking,
for this
Column. |
abstract void |
setRaw(Persistent g,
Object raw)
Sets the field value, with locking,
for this
Column. |
void |
setRawString(Persistent g,
String rawString)
Set the value from its String representation, if possible.
|
void |
setSearchability(Searchability searchability) |
String |
toString() |
<O> void |
unifyType(SQLPoemType<O> storeType,
DefinitionSource source) |
void |
unifyWithMetadata(ResultSet colDescs) |
public Column(Table<?> table, String name, SQLPoemType<T> type, DefinitionSource definitionSource)
table - this column belongs toname - of this Columntype - datatypedefinitionSource - where it is being defined frompublic <O> void unifyType(SQLPoemType<O> storeType, DefinitionSource source)
public final Database getDatabase()
public final Table<Persistent> getTable()
public final String getName()
getName in interface FieldAttributes<T>FieldAttributes.getName()public final String quotedName()
public final String fullQuotedName()
public final String getDisplayName()
getDisplayName in interface FieldAttributes<T>FieldAttributes.getDisplayName()public final String getDescription()
getDescription in interface FieldAttributes<T>FieldAttributes.getDescription()public final ColumnInfo getColumnInfo()
public DisplayLevel getDisplayLevel()
public void setDisplayLevel(DisplayLevel level)
level - the DisplayLevel to setpublic Searchability getSearchability()
public void setSearchability(Searchability searchability)
searchability - the Searchability to setpublic final boolean getUserEditable()
getUserEditable in interface FieldAttributes<T>FieldAttributes.getUserEditable()public final boolean getUserCreateable()
getUserCreateable in interface FieldAttributes<T>FieldAttributes.getUserCreateable()public final SQLPoemType<T> getSQLType()
public final PoemType<T> getType()
getType in interface FieldAttributes<T>FieldAttributes.getType()public final boolean isTroidColumn()
public final boolean isDeletedColumn()
public final boolean getIndexed()
getIndexed in interface FieldAttributes<T>FieldAttributes.getIndexed()public final boolean getUnique()
public IntegrityFix getIntegrityFix()
public void setIntegrityFix(StandardIntegrityFix fix)
fix - the IntegrityFix to setpublic final String getRenderInfo()
getRenderInfo in interface FieldAttributes<T>FieldAttributes.getRenderInfo()public final int getWidth()
getWidth in interface FieldAttributes<T>FieldAttributes.getWidth()public final int getHeight()
getHeight in interface FieldAttributes<T>FieldAttributes.getHeight()public final Integer getDisplayOrderPriority()
public final boolean getSortDescending()
public String toString()
toString in class ObjectObject.toString()public void dump()
public void dump(PrintStream ps)
ps - PrintStream to dump topublic String eqClause(Object raw)
raw - An object with an equivalent SQL typepublic Enumeration<Persistent> selectionWhereEq(Object raw)
raw - a raw value such as a Stringpublic Persistent firstWhereEq(Object raw)
raw - Object of correct type for this Columnpublic CachedSelection cachedSelectionWhereEq(Object raw)
raw - Object of correct type for this Columnpublic abstract Object getRaw(Persistent g) throws AccessPoemException
Column.g - the Persistent to readAccessPoemException - if the current AccessToken
does not confer read access rightspublic abstract Object getRaw_unsafe(Persistent g)
Column.g - the Persistent to readpublic abstract void setRaw(Persistent g, Object raw) throws AccessPoemException, ValidationPoemException
Column.g - the Persistent to modifyraw - the value to set the field toAccessPoemException - if the current AccessToken
does not confer write access rightsValidationPoemException - if the raw value is not validpublic abstract void setRaw_unsafe(Persistent g, Object raw)
Column.g - the Persistent to modifyraw - the value to set the field topublic abstract Object getCooked(Persistent g) throws AccessPoemException, PoemException
Column.g - the Persistent to modifyAccessPoemException - if the current AccessToken
does not confer read access rightsPoemException - if any problem occurspublic abstract void setCooked(Persistent g, Object cooked) throws AccessPoemException, ValidationPoemException
Column.g - the Persistent to modifycooked - the value to setAccessPoemException - if the current AccessToken
does not confer read access rightsValidationPoemException - if the value is not validpublic abstract Field<T> asField(Persistent g)
g - the Persistentpublic Field<T> asEmptyField()
public void setRawString(Persistent g, String rawString)
g - the Persistent to alterrawString - the String representation of the value to setpublic Enumeration<Persistent> referencesTo(Persistent object)
Persistents from the
Table this column refers to, if this is a reference column,
otherwise the Empty Enumeration.object - A persistent of the type referred to by this columnPersistents referencing this Column of the Persistentpublic Persistent ensure(Persistent orCreate)
Persistent.
The given object is used to create a new row if
necessary, in which case it will be assigned the next troid and
cached.orCreate - the Persistent to use as criteria and ensurepublic int firstFree(String whereClause)
whereClause - the SQL fragment to usepublic void unifyWithMetadata(ResultSet colDescs) throws SQLException
colDescs - from DatabaseMetaData.getColumns, with cursor at current rowSQLExceptionCopyright © 2000–2021 PanEris. All rights reserved.