public abstract class ComposedRecord extends TransferableObject implements DBRecord
| Constructor and Description |
|---|
ComposedRecord() |
| Modifier and Type | Method and Description |
|---|---|
ComposedRecord |
clone()
Performs a deep clone of this object.
|
void |
copyRecordValues(DBRecord otherRecord,
boolean isIncludePK) |
protected abstract DBRecord |
createInstance(DBObject dbo)
Must be implemented by subclasses
|
protected abstract DBRecord |
createInstance(java.lang.String[] primaryKey)
Must be implemented by subclasses
|
void |
dbLoad(DBLoadMonitor monitor,
SqlCondition condition)
Reads a set of objects from from the database according to the given condition.
|
void |
dbLoad(DBLoadMonitor monitor,
SqlCondition condition,
SqlOrder order)
Performs a monitored load of records.
|
void |
dbRehash()
Rehashes all DBObjects this record is composed of.
|
void |
dbSearch(DBLoadMonitor monitor,
SqlCondition condition)
Reads a set of objects from from the database according to the given condition.
|
void |
dbSearch(DBLoadMonitor monitor,
SqlCondition condition,
SqlOrder order)
Reads a set of objects from from the database according to the given condition and order.
|
DBRecord[] |
dbSearch(SqlCondition condition)
Reads a set of objects from from the database according to the given condition.
|
DBRecord[] |
dbSearch(SqlCondition condition,
SqlOrder order)
Reads a set of objects from from the database according to
the given condition and order.
|
DBRecord[] |
dbSelect(SqlCondition condition)
Reads a set of objects from from the database according to the given condition.
|
DBRecord[] |
dbSelect(SqlCondition condition,
SqlOrder order)
Reads ComposedRecord instances from the database.
|
<T> T |
deepClone()
Returns a deep clone of this object
|
boolean |
equals(java.lang.Object o) |
boolean |
exists()
Checks the existance of all DBObjects this record is composed of.
|
boolean |
existsField(java.lang.String fieldName)
Tells wasCancelled this field exists in this DBObject.
|
abstract DBRecord[] |
getAvailableSubTypes()
Returns an array of instances of sub-types of this composed record type.
|
int |
getFieldCount()
Returns the number columns of this DBObject including primary key columns
|
java.lang.String[] |
getFieldFullNames()
Returns the full names of all columns in the format table.column
|
int |
getFieldLength(java.lang.String fieldName)
Returns the length (in number or characters) of the given fieldname.
|
java.lang.String[] |
getFieldNames()
Returns the names of all columns without the table prefix
|
java.lang.String |
getForeignKeyRef(java.lang.String fieldName)
If the given field is a foreign key field then the referenced
fieldname is returned in the format table.column.
|
java.lang.Class |
getJavaType(java.lang.String fieldName)
Returns the java variable type of the given fieldname.
|
int |
getJdbcType(java.lang.String fieldName)
Returns the jdbc-type of the given fieldname.
|
DBObject |
getLastManagedDBObject()
Returns the bottom element in the list of managed DBObjects
|
abstract DBRecord |
getParentType()
Returns the parent in inheritance hierarchy.
|
int |
getPrimaryKeyCount()
Returns the number of fields that compose the primary key
|
java.lang.String[] |
getPrimaryKeyValues()
Returns the values of the primary key as a String array.
|
java.lang.String |
getRecordName()
Returns a unique name for this record, which is usually the tablename.
|
java.awt.Color |
getRenderColor() |
javax.swing.Icon |
getRenderIcon() |
java.lang.String |
getTranslationAppKey()
Returns the main translation key for this record.
|
java.lang.Object |
getValue(java.lang.String fieldName)
Returns the current value of the given fieldname.
|
int |
hashCode() |
boolean |
hasPrimaryKey()
Tells whether this object has a primary key at all
|
boolean |
isDirty()
Tells whether any of the managed DBObjects has been changed and is
not in sync with the database any more.
|
boolean |
isFieldVirtual(java.lang.String fieldName)
Tells wasCancelled this field is supposed to be editable.
|
boolean |
isForeignKey(java.lang.String fieldName)
Tells wasCancelled this field is a foreign key field.
|
boolean |
isNotNullField(java.lang.String fieldName)
Tells wasCancelled this field is a not null field.
|
boolean |
isPrimaryKey(java.lang.String fieldName)
Tells wasCancelled this field is or is part of the primary key.
|
void |
setPrimaryKeyValues(java.lang.String... pkValues)
Sets the values of the primary key.
|
DumpString |
toDumpString(DumpString s)
This method allows subclasses to add values to the existing DumpString of the superclass.
|
ToString |
toString(ToString s)
This method allows subclasses to add values to the existing ToString of the superclass.
|
configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitgetFieldIcon, getManagedDBObjects, getMasterRecorddbDelete, dbInsert, dbUpdatetoDumpString, toStringgetRenderTextpublic java.lang.String getTranslationAppKey()
DBRecordgetTranslationAppKey in interface DBRecordpublic boolean hasPrimaryKey()
DBPersistenthasPrimaryKey in interface DBPersistentpublic javax.swing.Icon getRenderIcon()
getRenderIcon in interface Renderablepublic java.awt.Color getRenderColor()
getRenderColor in interface Renderablepublic DBRecord[] dbSelect(SqlCondition condition) throws java.lang.Exception
DBPersistentdbSelect in interface DBPersistentjava.lang.Exceptionpublic void dbLoad(DBLoadMonitor monitor, SqlCondition condition) throws java.lang.Exception
DBPersistentdbLoad in interface DBPersistentjava.lang.Exceptionpublic DBRecord[] dbSearch(SqlCondition condition) throws java.lang.Exception
DBPersistentdbSearch in interface DBPersistentjava.lang.Exceptionpublic DBRecord[] dbSearch(SqlCondition condition, SqlOrder order) throws java.lang.Exception
DBPersistentdbSearch in interface DBPersistentjava.lang.Exceptionpublic void dbSearch(DBLoadMonitor monitor, SqlCondition condition) throws java.lang.Exception
DBPersistentdbSearch in interface DBPersistentjava.lang.Exceptionpublic void dbSearch(DBLoadMonitor monitor, SqlCondition condition, SqlOrder order) throws java.lang.Exception
DBPersistentdbSearch in interface DBPersistentjava.lang.Exceptionpublic ComposedRecord clone()
clone in class TransferableObjectprotected abstract DBRecord createInstance(java.lang.String[] primaryKey) throws java.lang.Exception
java.lang.Exceptionprotected abstract DBRecord createInstance(DBObject dbo) throws java.lang.Exception
java.lang.Exceptionpublic int getPrimaryKeyCount()
DBPersistentgetPrimaryKeyCount in interface DBPersistentpublic java.lang.String[] getPrimaryKeyValues()
DBPersistentgetPrimaryKeyValues in interface DBPersistentpublic void setPrimaryKeyValues(java.lang.String... pkValues)
DBPersistentsetPrimaryKeyValues in interface DBPersistentpublic java.lang.String getForeignKeyRef(java.lang.String fieldName)
DBRecordgetForeignKeyRef in interface DBRecordfieldName - The name of the field in the format table.column -
only the column name is checked!public boolean isForeignKey(java.lang.String fieldName)
DBRecordisForeignKey in interface DBRecordfieldName - might be a pure column name or in the format table.column -
only the column name is checked!DBRecord.getForeignKeyRef(String)public boolean isPrimaryKey(java.lang.String fieldName)
DBRecordisPrimaryKey in interface DBRecordfieldName - might be a pure column name or in the format table.column -
only the column name is checked!public int getFieldCount()
DBRecordgetFieldCount in interface DBRecordpublic java.lang.String getRecordName()
DBPersistentgetRecordName in interface DBPersistentpublic java.lang.String[] getFieldFullNames()
DBRecordgetFieldFullNames in interface DBRecordpublic java.lang.String[] getFieldNames()
DBRecordgetFieldNames in interface DBRecordpublic boolean existsField(java.lang.String fieldName)
DBRecordexistsField in interface DBRecordfieldName - might be a pure column name or in the format table.column -
only the column name is checked!public java.lang.Object getValue(java.lang.String fieldName)
DBRecordpublic boolean isNotNullField(java.lang.String fieldName)
DBRecordisNotNullField in interface DBRecordfieldName - might be a pure column name or in the format table.column -
only the column name is checked!public boolean isFieldVirtual(java.lang.String fieldName)
DBRecordisFieldVirtual in interface DBRecordfieldName - can be the pure column name or in the format table.column -
only the column name is checked!public int getJdbcType(java.lang.String fieldName)
DBRecordgetJdbcType in interface DBRecordfieldName - might be a pure column name or in the format table.column -
only the column name is checked!Typespublic int getFieldLength(java.lang.String fieldName)
DBRecordgetFieldLength in interface DBRecordfieldName - might be a pure column name or in the format table.column -
only the column name is checked!public java.lang.Class getJavaType(java.lang.String fieldName)
DBRecordgetJavaType in interface DBRecordfieldName - might be a pure column name or in the format table.column -
only the column name is checked!public ToString toString(ToString s)
DumpabletoString in interface DumpabletoString in class DumpableObjectpublic DumpString toDumpString(DumpString s)
DumpabletoDumpString in interface DumpabletoDumpString in class DumpableObjectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic void dbRehash()
throws java.lang.Exception
dbRehash in interface DBPersistentjava.lang.ExceptionDBPersistent.isDirty()public boolean exists()
exists in interface DBPersistentpublic boolean isDirty()
isDirty in interface DBPersistentpublic DBObject getLastManagedDBObject()
public void dbLoad(DBLoadMonitor monitor, SqlCondition condition, SqlOrder order) throws java.lang.Exception
1st) read all DBO_xyy records with a cancellable RecordIterator
2nd) in a canclelable loop create Xyy instances from the DBO_xyy records
Note that the filter condition may only contain properties of the subclass at the very bottom of the hierarchy.
dbLoad in interface DBPersistentjava.lang.Exceptionpublic DBRecord[] dbSelect(SqlCondition condition, SqlOrder order) throws java.lang.Exception
Note that the filter condition may only contain properties of the subclass at the very bottom of the hierarchy.
dbSelect in interface DBPersistentjava.lang.Exceptionpublic abstract DBRecord[] getAvailableSubTypes()
public abstract DBRecord getParentType()
public <T> T deepClone()
DeepCloneabledeepClone in interface DeepCloneabledeepClone in class TransferableObjectpublic void copyRecordValues(DBRecord otherRecord, boolean isIncludePK) throws java.lang.Exception
copyRecordValues in interface DBRecordjava.lang.ExceptionCopyright © 2014 EsprIT-Systems. All Rights Reserved.