public abstract class AbstractDBRecordABO<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject> extends AbstractPersistentABO<C,S,I> implements DBRecord
DBRecord
interface and thus can be
handled by DBRecordTable
, DBRecordList
and other DBRecord
capable classes.
All methods just delgate to the internally kept DBRecord
instance. This class is very useful
if you want to extend your database objects with non persistent fields.DBRecord
,
Serialized FormConstructor and Description |
---|
AbstractDBRecordABO(C clientCtx) |
AbstractDBRecordABO(S serverCtx) |
AbstractDBRecordABO(S serverCtx,
DBRecord record) |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(java.lang.Object arg) |
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.
|
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 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.
|
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.
|
DBRecord |
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.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.
|
createNewRecord, createOnServer, createPrimaryKey, createRecord, deleteOnServer, equals, find, getRecord, getRenderIcon, overtakeABOValues, setRecord, toDumpString, updateOnServer
addChangeListener, clone, copyABOValues, create, createChangeGate, createPermissionDefinition, deepClone, delete, drop, dropOnServer, fetch, findCachedABOs, fireABOInitialized, getPermissionDefinition, getPrimaryKey, getRenderColor, getRenderText, getResourceName, getResourceType, getUpdateCount, hashCode, isbeingAccessed, isCacheResident, isLockedByMe, isNumb, isOnline, isVisibleInClientMonitor, receivedUpdateEvent, refetch, removeChangeListener, setLocked, setNumb, toString, update, update
getLastAccessedTs, getLastAccessorId, setLastAccessorId
checkOnClient, checkOnServer, getClientContext, getLogChannel, getServerContext, isLogDebug, isLogVerbose, isOnClient, isOnServer, logDebug, logDump, logError, logError, logFatal, logInfo, logVerbose, logWarning, setClientContext, setLogChannel, setServerContext
configureDumpHeadlineLength, configureDumpMaxElementsPrinted, copyDumpStringValues, copyToStringValues, createDumpHeader, toDumpString, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
copyRecordValues, getTranslationAppKey
deepClone
toDumpString, toDumpString, toString, toString
getRenderColor, getRenderIcon, getRenderText
createEditDialog, instantiateOnServer
isOnClient, isOnServer, setClientContext, setServerContext
getClientContext
getServerContext
getLastAccessedTs, getLastAccessorId, setLastAccessorId
public AbstractDBRecordABO(C clientCtx)
public AbstractDBRecordABO(S serverCtx)
public int getFieldCount()
DBRecord
getFieldCount
in interface DBRecord
public java.lang.String[] getFieldFullNames()
DBRecord
getFieldFullNames
in interface DBRecord
public java.lang.String[] getFieldNames()
DBRecord
getFieldNames
in interface DBRecord
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 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 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 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 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 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 java.lang.Object getValue(java.lang.String fieldName)
DBRecord
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 java.lang.String getFieldIcon(java.lang.String fieldName)
DBRecord
getFieldIcon
in interface DBRecord
fieldName
- might be a pure column name or in the format table.column -
only the column name is checked!public DBObject[] getManagedDBObjects()
DBRecord
getManagedDBObjects
in interface DBRecord
public DBRecord getMasterRecord()
getMasterRecord
in interface DBRecord
public boolean hasPrimaryKey()
DBPersistent
hasPrimaryKey
in interface DBPersistent
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 void dbUpdate() throws java.lang.Exception
DBPersistent
dbUpdate
in interface DBPersistent
java.lang.Exception
DBPersistent.isDirty()
public void dbInsert() throws java.lang.Exception
DBPersistent
dbInsert
in interface DBPersistent
java.lang.Exception
public void dbDelete() throws java.lang.Exception
DBPersistent
dbDelete
in interface DBPersistent
java.lang.Exception
DBPersistent.isDirty()
public void dbRehash() throws java.lang.Exception
DBPersistent
dbRehash
in interface DBPersistent
java.lang.Exception
DBPersistent.isDirty()
public DBRecord[] dbSelect(SqlCondition condition) throws java.lang.Exception
DBPersistent
dbSelect
in interface DBPersistent
java.lang.Exception
public DBRecord[] dbSelect(SqlCondition condition, SqlOrder order) 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 void dbLoad(DBLoadMonitor monitor, SqlCondition condition, SqlOrder order) 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 boolean exists()
DBPersistent
exists
in interface DBPersistent
public boolean isDirty()
DBPersistent
isDirty
in interface DBPersistent
public java.lang.String getRecordName()
DBPersistent
getRecordName
in interface DBPersistent
public int compareTo(java.lang.Object arg)
compareTo
in interface java.lang.Comparable
compareTo
in class AbstractABO<C extends ClientContext,S extends ServerContext,I extends AliveBusinessObject>
Copyright © 2014 EsprIT-Systems. All Rights Reserved.