org.tentackle.appworx
Class PartialAppDbObject

java.lang.Object
  extended by org.tentackle.db.DbObject
      extended by org.tentackle.appworx.AppDbObject
          extended by org.tentackle.appworx.PartialAppDbObject
All Implemented Interfaces:
Serializable, Cloneable, Comparable<DbObject>, ContextDependable

public abstract class PartialAppDbObject
extends AppDbObject

Partial implementation of an AppDbObject that is an abstract super class in a table-per-class mapping.

Author:
harald
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.tentackle.db.DbObject
DbObject.CopyAllToDbLogger, DbObject.IdComparator<T extends DbObject>, DbObject.NameComparator<T extends DbObject>, DbObject.NameIdComparator<T extends DbObject>
 
Field Summary
 
Fields inherited from class org.tentackle.appworx.AppDbObject
FIELD_EDITEDBY, FIELD_EDITEDEXPIRY, FIELD_EDITEDSINCE, FIELD_NORMTEXT, TX_DELETE_ALL_IN_CONTEXT, TX_SAVE_COPY_IN_CONTEXT, TX_TRANSFER_EDITEDBY, VERIFIED_DUPLICATE
 
Fields inherited from class org.tentackle.db.DbObject
BEGIN, COMMIT, DELETE, DELETEALL, FIELD_ID, FIELD_SERIAL, FIELD_TABLESERIAL, idComparator, INSERT, lazyMethodInterval, nameComparator, nameIdComparator, TX_DELETE_LIST, TX_DELETE_MISSING_IN_LIST, TX_DELETE_OBJECT, TX_DUMMY_UPDATE, TX_INSERT_OBJECT, TX_INSERT_PLAIN, TX_SAVE, TX_SAVE_LIST, TX_UPDATE_OBJECT, TX_UPDATE_PLAIN, TX_UPDATE_SERIAL, TX_UPDATE_SERIAL_AND_TABLESERIAL, TX_UPDATE_TABLESERIAL, UPDATE
 
Constructor Summary
PartialAppDbObject(AppDbObject master)
          Creates a partial object for a given master object.
 
Method Summary
 String getClassBaseName()
          Gets the basename of the class of this object.
The basename is the class name without the package name.
 String getClassName()
          Gets the class name of this object.
This is equivalent to getClass().getName() except for PartialDbObjects!
 ContextDb getContextDb()
          Gets the database application context this object belongs to.
 Db getDb()
          Get the logical db connection for this object.
 long getId()
          Gets the object ID.
 String getNormText()
          Gets the normtext.
 boolean isEntity()
          Returns whether instances of this class exist as database entities.
 boolean isNew()
          Checks whether this object is already persistant in the db or only residing in memory.
 boolean isPartial()
          Returns true if object is only a partial implementation.
 void setContextDb(ContextDb contextDb)
          Sets this object's database application context.
 void setContextId()
          Determines the object-ID(s) of the root object(s) of the context and sets the attributes of the database object accordingly.
 void setDb(Db db)
          Sets the logical db connection for this object.
 void setId(long id)
          Sets the unique ID of this object.
 void setNormText(String normText)
          Sets the normtext.
 void setSerial(long serial)
          Sets the serial number (modification count).
 String toGenericString()
          Gets the string value: "DbObject.getSingleName()[id/serial]".
Example: "Product[344/2]"
 String toString()
          Gets the default string value.
The default implementation invokes DbObject.toGenericString().
 
Methods inherited from class org.tentackle.appworx.AppDbObject
allowsHistory, allowsTreeChildObjects, allowsTreeParentObjects, clearEditedBy, containsPattern, copy, copyCollection, copyLazyValues, countCacheAccess, countModification, createCopyInContextDb, dropTransferable, expireCache, extractTreePath, extractTreePathObjects, filterAppDbObjects, findDuplicate, finishModification, finishNotUpdated, getAppDbObjectClassVariables, getBaseContext, getCache, getCacheAccessCount, getCacheAccessTime, getClassPath, getContextId, getCopiedObject, getDbObjectClassVariables, getEditedBy, getEditedByObject, getEditedExpiry, getEditedSince, getFormTableEntry, getFormTableName, getHistory, getMultiName, getPanelObject, getRemoteDelegate, getSecurityManager, getSecurityResult, getSelectAllInContextCursorStatementId, getSelectAllInContextStatementId, getSelectByNormTextCursorStatementId, getSelectByNormTextStatementId, getSelectEditedByStatementId, getSingleName, getSqlContextCondition, getToolTipText, getToolTipText, getTransferable, getTransferEditedByStatementId, getTransientData, getTreeChildObjects, getTreeChildObjects, getTreeExpandMaxDepth, getTreeParentObjects, getTreeParentObjects, getTreeRoot, getTreeText, getTreeText, getUpdateEditedByOnlyStatementId, getUpdateEditedByStatementId, getUpdateEditedByTimeout, initModification, invalidateLazyValues, isCacheable, isCached, isComposite, isEditedLocked, isExpired, isInstantiatable, isLoggingHistory, isPermissionAccepted, isPermissionDefault, isPermissionDenied, isReferenced, isShowable, isShowableLazy, loadClass, loadComposites, loadComposites, logHistory, makeQbfPlugin, makeQbfPlugin, makeValidContext, markCacheAccess, newByClass, newByClassBaseName, newObject, newPanel, orderBy, panelExists, permissionType, prepareSelectEditedByStatement, prepareSetFields, prepareTransferEditedByStatement, prepareUpdateEditedByOnlyStatement, prepareUpdateEditedByStatement, presetQbfParameter, readFromResultSetWrapper, resultAllInContext, resultAllInContextCursor, resultByNormText, resultByNormTextCursor, save, saveCopyInContextDb, saveInContextDb, searchQbf, searchQbfCursor, select, select, select, select, selectAll, selectAllInContext, selectAllInContext, selectAllInContextCached, selectAllInContextCursor, selectAllInValidContext, selectAllInValidContext, selectByNormText, selectByNormTextCursor, selectByTemplate, selectCached, selectCached, selectCached, selectInValidContext, selectInValidContext, selectInValidContext, selectInValidContext, selectInValidContext, selectInValidContext, selectLocked, selectLocked, selectLocked, selectLocked, setCacheAccessCount, setCacheAccessTime, setClassPath, setEditedBy, setEditedByObject, setEditedExpiry, setEditedSince, setExpired, setSelectAllInContextCursorStatementId, setSelectAllInContextStatementId, setSelectByNormTextCursorStatementId, setSelectByNormTextStatementId, setSelectEditedByStatementId, setTransferEditedByStatementId, setTransientData, setUpdateEditedByOnlyStatementId, setUpdateEditedByStatementId, stopTreeExpansion, transferEditedBy, updateEditedBy, updateEditedBy, updateEditedByOnly, updateObject, verify
 
Methods inherited from class org.tentackle.db.DbObject
_delete, _save, alwaysPrepare, assertLazyNotWithinTX, attributesModified, beginTx, clone, compareTo, copyAllToDb, copyToDb, countModification, createModificationLog, delete, deleteLinkedObjects, deleteList, deleteMissingInList, deleteObject, deletePlain, dummyUpdate, equals, getDeleteStatementId, getDummyUpdateStatementId, getExpirationBacklog, getExpiredTableSerials, getFieldCount, getFields, getIcon, getIdSource, getInsertStatementId, getMultiName, getRemoteDelegateId, getSelectAllStatementId, getSelectExpiredTableSerials1StatementId, getSelectExpiredTableSerials2StatementId, getSelectLockedStatementId, getSelectSerialStatementId, getSelectStatementId, getSerial, getSingleName, getSqlAllFields, getSqlPrefix, getSqlPrefixWithDot, getSqlSelectAllFields, getTableName, getTableSerial, getUpdateSerialAndTableSerialStatementId, getUpdateSerialStatementId, getUpdateStatementId, getUpdateTableSerialStatementId, hashCode, insert, insertObject, insertPlain, isCountingModification, isDeleted, isEditable, isEditableLazy, isGettingFieldCount, isIdValid, isLazyElapsed, isListModified, isLoggingModification, isModified, isReferencedLazy, isRemovable, isRemovableLazy, isSaveable, isTableSerialValid, isTracked, isTxObject, isUpdatingSerialEvenIfNotModified, isVirgin, loadLinkedObjects, logModification, markDeleted, markListDeleted, newByClass, newByClass, newByClassWrapped, newId, prepareDeleteStatement, prepareDummyUpdateStatement, prepareInsertStatement, prepareSelectLockedStatement, prepareSelectSerialStatement, prepareSelectStatement, prepareUpdateSerialAndTableSerialStatement, prepareUpdateSerialStatement, prepareUpdateStatement, prepareUpdateTableSerialStatement, readFromResultSetWrapper, reload, reloadLocked, reserveId, saveLinkedObjects, saveList, saveList, select, select, selectAll, selectAll, selectAllCursor, selectAllCursor, selectAllResultSet, selectExpiredTableSerials, selectExpiredTableSerials, selectModification, selectNext, selectSerial, selectSerial, setAlwaysPrepare, setDeleteStatementId, setDummyUpdateStatementId, setFields, setInsertStatementId, setModified, setSelectAllStatementId, setSelectExpiredTableSerials1StatementId, setSelectExpiredTableSerials2StatementId, setSelectLockedStatementId, setSelectSerialStatementId, setSelectStatementId, setTableSerial, setUpdateSerialAndTableSerialStatementId, setUpdateSerialStatementId, setUpdateStatementId, setUpdateTableSerialStatementId, sync, syncObject, update, updateFieldCount, updateFields, updatePlain, updateSerial, updateSerialAndTableSerial, updateTableSerial
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PartialAppDbObject

public PartialAppDbObject(AppDbObject master)
Creates a partial object for a given master object.

Parameters:
master - the master object
Method Detail

isPartial

public boolean isPartial()
Returns true if object is only a partial implementation. This is used in conjunction with PartialAppDbObject and the wurblet AppDbSuper for abstract super classes in a table-per-class mapping.

Overridden to return true. Notice that for hierarchies of depth > 2 the DbGetFields wurblet must be invoked with the "--nameonly" option.

Overrides:
isPartial in class DbObject
Returns:
true if partial implementation

isEntity

public boolean isEntity()
Returns whether instances of this class exist as database entities. The default is true. An example of a non-entity object is PartialDbObject.

Overridden to return false. Partial object are not entities by definition.

Overrides:
isEntity in class DbObject
Returns:
true if entity

getDb

public Db getDb()
Description copied from class: DbObject
Get the logical db connection for this object.

Overrides:
getDb in class DbObject
Returns:
the db connection

setDb

public void setDb(Db db)
Description copied from class: AppDbObject
Sets the logical db connection for this object.

Overridden to set the Db in ContextDb as well.

Overrides:
setDb in class AppDbObject
Parameters:
db - the db connection

getClassBaseName

public String getClassBaseName()
Description copied from class: DbObject
Gets the basename of the class of this object.
The basename is the class name without the package name.

Overrides:
getClassBaseName in class DbObject
Returns:
the basename of the Objects class

getId

public long getId()
Description copied from class: DbObject
Gets the object ID. If the object is deleted (negated ID) the returned ID is still positive!

Overrides:
getId in class DbObject
Returns:
the object id

setId

public void setId(long id)
Description copied from class: DbObject
Sets the unique ID of this object. Does not set this object to be modified, see DbObject.isModified().

Overrides:
setId in class DbObject
Parameters:
id - the object id

setSerial

public void setSerial(long serial)
Description copied from class: DbObject
Sets the serial number (modification count). Does not set this object to be modified, see DbObject.isModified().

Overrides:
setSerial in class DbObject
Parameters:
serial - the serial number

isNew

public boolean isNew()
Description copied from class: DbObject
Checks whether this object is already persistant in the db or only residing in memory. If an object isNew(), it means that it can be inserted. This does not mean, that the object never has been stored in the db, i.e. it is possible that the object just has been deleted.

Overrides:
isNew in class DbObject
Returns:
true if object is not in database, i.e. new (or deleted)

getNormText

public String getNormText()
Description copied from class: AppDbObject
Gets the normtext.

Overrides:
getNormText in class AppDbObject
Returns:
the normtext

setNormText

public void setNormText(String normText)
Description copied from class: AppDbObject
Sets the normtext.

Overrides:
setNormText in class AppDbObject
Parameters:
normText - the normtext

toString

public String toString()
Description copied from class: DbObject
Gets the default string value.
The default implementation invokes DbObject.toGenericString().

Overrides:
toString in class DbObject
Returns:
the string value of this DbObject

toGenericString

public String toGenericString()
Description copied from class: DbObject
Gets the string value: "DbObject.getSingleName()[id/serial]".
Example: "Product[344/2]"

Overrides:
toGenericString in class DbObject
Returns:
the string value of this DbObject

getContextDb

public ContextDb getContextDb()
Description copied from class: AppDbObject
Gets the database application context this object belongs to.

The default implementation just returns the context. Subclasses may override this with a covariant method.

Specified by:
getContextDb in interface ContextDependable
Overrides:
getContextDb in class AppDbObject
Returns:
the context

setContextDb

public void setContextDb(ContextDb contextDb)
Description copied from class: AppDbObject
Sets this object's database application context.

Setting the context will also DbObject.setDb(org.tentackle.db.Db) and AppDbObject.setContextId()

Specified by:
setContextDb in interface ContextDependable
Overrides:
setContextDb in class AppDbObject

setContextId

public void setContextId()
Description copied from class: AppDbObject
Determines the object-ID(s) of the root object(s) of the context and sets the attributes of the database object accordingly.

The default implementation does nothing (object living in a context not depending on another object).

Specified by:
setContextId in interface ContextDependable
Overrides:
setContextId in class AppDbObject

getClassName

public String getClassName()
Description copied from class: DbObject
Gets the class name of this object.
This is equivalent to getClass().getName() except for PartialDbObjects!

Overrides:
getClassName in class DbObject
Returns:
the classname


Copyright © 2001-2008 Harald Krake, Bergstr. 48, 78098 Triberg, Germany, harald@krake.de