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, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
getFieldIcon, getManagedDBObjects, getMasterRecord
dbDelete, dbInsert, dbUpdate
toDumpString, toString
getRenderText
public java.lang.String getTranslationAppKey()
DBRecord
getTranslationAppKey
in interface DBRecord
public boolean hasPrimaryKey()
DBPersistent
hasPrimaryKey
in interface DBPersistent
public javax.swing.Icon getRenderIcon()
getRenderIcon
in interface Renderable
public java.awt.Color getRenderColor()
getRenderColor
in interface Renderable
public DBRecord[] dbSelect(SqlCondition condition) throws java.lang.Exception
DBPersistent
dbSelect
in interface DBPersistent
java.lang.Exception
public void dbLoad(DBLoadMonitor monitor, SqlCondition condition) throws java.lang.Exception
DBPersistent
dbLoad
in interface DBPersistent
java.lang.Exception
public DBRecord[] dbSearch(SqlCondition condition) throws java.lang.Exception
DBPersistent
dbSearch
in interface DBPersistent
java.lang.Exception
public DBRecord[] dbSearch(SqlCondition condition, SqlOrder order) throws java.lang.Exception
DBPersistent
dbSearch
in interface DBPersistent
java.lang.Exception
public void dbSearch(DBLoadMonitor monitor, SqlCondition condition) throws java.lang.Exception
DBPersistent
dbSearch
in interface DBPersistent
java.lang.Exception
public void dbSearch(DBLoadMonitor monitor, SqlCondition condition, SqlOrder order) throws java.lang.Exception
DBPersistent
dbSearch
in interface DBPersistent
java.lang.Exception
public ComposedRecord clone()
clone
in class TransferableObject
protected abstract DBRecord createInstance(java.lang.String[] primaryKey) throws java.lang.Exception
java.lang.Exception
protected abstract DBRecord createInstance(DBObject dbo) throws java.lang.Exception
java.lang.Exception
public int getPrimaryKeyCount()
DBPersistent
getPrimaryKeyCount
in interface DBPersistent
public java.lang.String[] getPrimaryKeyValues()
DBPersistent
getPrimaryKeyValues
in interface DBPersistent
public void setPrimaryKeyValues(java.lang.String... pkValues)
DBPersistent
setPrimaryKeyValues
in interface DBPersistent
public java.lang.String getForeignKeyRef(java.lang.String fieldName)
DBRecord
getForeignKeyRef
in interface DBRecord
fieldName
- The name of the field in the format table.column -
only the column name is checked!public boolean isForeignKey(java.lang.String fieldName)
DBRecord
isForeignKey
in interface DBRecord
fieldName
- 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)
DBRecord
isPrimaryKey
in interface DBRecord
fieldName
- might be a pure column name or in the format table.column -
only the column name is checked!public int getFieldCount()
DBRecord
getFieldCount
in interface DBRecord
public java.lang.String getRecordName()
DBPersistent
getRecordName
in interface DBPersistent
public java.lang.String[] getFieldFullNames()
DBRecord
getFieldFullNames
in interface DBRecord
public java.lang.String[] getFieldNames()
DBRecord
getFieldNames
in interface DBRecord
public boolean existsField(java.lang.String fieldName)
DBRecord
existsField
in interface DBRecord
fieldName
- 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)
DBRecord
public boolean isNotNullField(java.lang.String fieldName)
DBRecord
isNotNullField
in interface DBRecord
fieldName
- 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)
DBRecord
isFieldVirtual
in interface DBRecord
fieldName
- 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)
DBRecord
getJdbcType
in interface DBRecord
fieldName
- might be a pure column name or in the format table.column -
only the column name is checked!Types
public int getFieldLength(java.lang.String fieldName)
DBRecord
getFieldLength
in interface DBRecord
fieldName
- 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)
DBRecord
getJavaType
in interface DBRecord
fieldName
- might be a pure column name or in the format table.column -
only the column name is checked!public ToString toString(ToString s)
Dumpable
toString
in interface Dumpable
toString
in class DumpableObject
public DumpString toDumpString(DumpString s)
Dumpable
toDumpString
in interface Dumpable
toDumpString
in class DumpableObject
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public void dbRehash() throws java.lang.Exception
dbRehash
in interface DBPersistent
java.lang.Exception
DBPersistent.isDirty()
public boolean exists()
exists
in interface DBPersistent
public boolean isDirty()
isDirty
in interface DBPersistent
public 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 DBPersistent
java.lang.Exception
public 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 DBPersistent
java.lang.Exception
public abstract DBRecord[] getAvailableSubTypes()
public abstract DBRecord getParentType()
public <T> T deepClone()
DeepCloneable
deepClone
in interface DeepCloneable
deepClone
in class TransferableObject
public void copyRecordValues(DBRecord otherRecord, boolean isIncludePK) throws java.lang.Exception
copyRecordValues
in interface DBRecord
java.lang.Exception
Copyright © 2014 EsprIT-Systems. All Rights Reserved.