public abstract class DBRecordWrapper<R extends DBRecord> extends DBRecordContainer<R> implements DBRecord
DBObject instance which implements the DBRecord interface and
thus can be handled by DBRecordTable, DBRecordList and other DBRecord capable classes. All methods
just delegate to the internally kept DBObject instance. This class is very useful if you want to extend your database
objects with non persistent fields.DBObject,
DBRecord,
Serialized Form| Constructor and Description |
|---|
DBRecordWrapper(R dbo) |
| Modifier and Type | Method and Description |
|---|---|
DBRecordWrapper |
clone() |
int |
compareTo(java.lang.Object arg) |
void |
copyRecordValues(DBRecord otherRecord,
boolean isIncludePK) |
void |
dbDelete()
Deletes the representing record from the database.
|
void |
dbInsert()
Inserts the object as a record into the database.
|
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)
Reads a set of objects from from the database according to the given condition and order.
|
void |
dbRehash()
Re-reads the object state from the database.
|
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.
|
R[] |
dbSearch(SqlCondition condition)
Reads a set of objects from from the database according to the given condition.
|
R[] |
dbSearch(SqlCondition condition,
SqlOrder order)
Reads a set of objects from from the database according to
the given condition and order.
|
R[] |
dbSelect(SqlCondition condition)
Reads a set of objects from from the database according to the given condition.
|
R[] |
dbSelect(SqlCondition condition,
SqlOrder order)
Reads a set of objects from from the database according to the given condition and order.
|
void |
dbUpdate()
Writes the object's current state to the database.
|
DBRecordWrapper |
deepClone()
Returns a deep clone of this object
|
boolean |
exists()
Checks whether a matching object can be found in the database
by performing a primary key lookup in the according table(s).
|
boolean |
existsField(java.lang.String fieldName)
Tells wasCancelled this field exists in this DBObject.
|
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
|
java.lang.String |
getFieldIcon(java.lang.String fieldName)
Returns the name for an icon that should be used to render this 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[] |
getManagedDBObjects()
If the instance is a DBObject then the DBObject itself is returned.
|
R |
getMasterRecord() |
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 |
getRenderText() |
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.
|
boolean |
hasPrimaryKey()
Tells whether this object has a primary key at all
|
boolean |
isDirty()
Tells whether this object is in sync with the database.
|
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.
|
equals, getRecord, hashCode, toDumpString, toStringconfigureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toStringfinalize, getClass, notify, notifyAll, wait, wait, waittoDumpString, toDumpString, toString, toStringpublic DBRecordWrapper(R dbo)
public java.lang.String getTranslationAppKey()
DBRecordgetTranslationAppKey in interface DBRecordpublic java.lang.String getRenderText()
getRenderText in interface Renderablepublic javax.swing.Icon getRenderIcon()
getRenderIcon in interface Renderablepublic java.awt.Color getRenderColor()
getRenderColor in interface Renderablepublic int getFieldCount()
DBRecordgetFieldCount in interface DBRecordpublic java.lang.String[] getFieldFullNames()
DBRecordgetFieldFullNames in interface DBRecordpublic java.lang.String[] getFieldNames()
DBRecordgetFieldNames in interface DBRecordpublic 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 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 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 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 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 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 java.lang.Object getValue(java.lang.String fieldName)
DBRecordpublic 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 java.lang.String getFieldIcon(java.lang.String fieldName)
DBRecordgetFieldIcon in interface DBRecordfieldName - might be a pure column name or in the format table.column -
only the column name is checked!public DBObject[] getManagedDBObjects()
DBRecordgetManagedDBObjects in interface DBRecordpublic R getMasterRecord()
getMasterRecord in interface DBRecordpublic boolean hasPrimaryKey()
DBPersistenthasPrimaryKey in interface DBPersistentpublic int getPrimaryKeyCount()
DBPersistentgetPrimaryKeyCount in interface DBPersistentpublic java.lang.String[] getPrimaryKeyValues()
DBPersistentgetPrimaryKeyValues in interface DBPersistentpublic void setPrimaryKeyValues(java.lang.String... pkValues)
DBPersistentsetPrimaryKeyValues in interface DBPersistentpublic void dbUpdate()
throws java.lang.Exception
DBPersistentdbUpdate in interface DBPersistentjava.lang.ExceptionDBPersistent.isDirty()public void dbInsert()
throws java.lang.Exception
DBPersistentdbInsert in interface DBPersistentjava.lang.Exceptionpublic void dbDelete()
throws java.lang.Exception
DBPersistentdbDelete in interface DBPersistentjava.lang.ExceptionDBPersistent.isDirty()public void dbRehash()
throws java.lang.Exception
DBPersistentdbRehash in interface DBPersistentjava.lang.ExceptionDBPersistent.isDirty()public R[] dbSelect(SqlCondition condition) throws java.lang.Exception
DBPersistentdbSelect in interface DBPersistentjava.lang.Exceptionpublic R[] dbSelect(SqlCondition condition, SqlOrder order) 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 void dbLoad(DBLoadMonitor monitor, SqlCondition condition, SqlOrder order) throws java.lang.Exception
DBPersistentdbLoad in interface DBPersistentjava.lang.Exceptionpublic R[] dbSearch(SqlCondition condition) throws java.lang.Exception
DBPersistentdbSearch in interface DBPersistentjava.lang.Exceptionpublic R[] 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 boolean exists()
DBPersistentexists in interface DBPersistentpublic boolean isDirty()
DBPersistentisDirty in interface DBPersistentpublic java.lang.String getRecordName()
DBPersistentgetRecordName in interface DBPersistentpublic int compareTo(java.lang.Object arg)
compareTo in interface java.lang.Comparablepublic DBRecordWrapper clone()
clone in class DBRecordContainer<R extends DBRecord>public DBRecordWrapper deepClone()
DeepCloneabledeepClone in interface DeepCloneabledeepClone in class DBRecordContainer<R extends DBRecord>public void copyRecordValues(DBRecord otherRecord, boolean isIncludePK) throws java.lang.Exception
copyRecordValues in interface DBRecordjava.lang.ExceptionCopyright © 2014 EsprIT-Systems. All Rights Reserved.