org.tentackle.db
Class PartialDbObject

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

public abstract class PartialDbObject
extends DbObject

Partial implementation of a DbObject 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.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
PartialDbObject(DbObject 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!
 Db getDb()
          Get the logical db connection for this object.
 long getId()
          Gets the object ID.
 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 setDb(Db db)
          Sets the logical db connection for this object.
 void setId(long id)
          Sets the unique ID of this object.
 void setSerial(long serial)
          Sets the serial number (modification count).
 
Methods inherited from class org.tentackle.db.DbObject
_delete, _save, alwaysPrepare, assertLazyNotWithinTX, attributesModified, beginTx, clone, compareTo, copyAllToDb, copyLazyValues, copyToDb, countModification, countModification, createModificationLog, delete, deleteLinkedObjects, deleteList, deleteMissingInList, deleteObject, deletePlain, dummyUpdate, equals, finishModification, finishNotUpdated, getDbObjectClassVariables, getDeleteStatementId, getDummyUpdateStatementId, getExpirationBacklog, getExpiredTableSerials, getFieldCount, getFields, getIcon, getIdSource, getInsertStatementId, getMultiName, getRemoteDelegate, getRemoteDelegateId, getSelectAllStatementId, getSelectExpiredTableSerials1StatementId, getSelectExpiredTableSerials2StatementId, getSelectLockedStatementId, getSelectSerialStatementId, getSelectStatementId, getSerial, getSingleName, getSqlAllFields, getSqlPrefix, getSqlPrefixWithDot, getSqlSelectAllFields, getTableName, getTableSerial, getUpdateSerialAndTableSerialStatementId, getUpdateSerialStatementId, getUpdateStatementId, getUpdateTableSerialStatementId, hashCode, initModification, insert, insertObject, insertPlain, invalidateLazyValues, isCountingModification, isDeleted, isEditable, isEditableLazy, isGettingFieldCount, isIdValid, isLazyElapsed, isListModified, isLoggingModification, isModified, isReferenced, isReferencedLazy, isRemovable, isRemovableLazy, isSaveable, isTableSerialValid, isTracked, isTxObject, isUpdatingSerialEvenIfNotModified, isVirgin, loadLinkedObjects, logModification, markDeleted, markListDeleted, newByClass, newByClass, newByClassWrapped, newId, newObject, prepareDeleteStatement, prepareDummyUpdateStatement, prepareInsertStatement, prepareSelectLockedStatement, prepareSelectSerialStatement, prepareSelectStatement, prepareSetFields, prepareUpdateSerialAndTableSerialStatement, prepareUpdateSerialStatement, prepareUpdateStatement, prepareUpdateTableSerialStatement, readFromResultSetWrapper, readFromResultSetWrapper, reload, reloadLocked, reserveId, save, saveLinkedObjects, saveList, saveList, select, select, select, select, selectAll, selectAll, selectAll, selectAllCursor, selectAllCursor, selectAllResultSet, selectExpiredTableSerials, selectExpiredTableSerials, selectInValidContext, selectLocked, selectLocked, selectModification, selectNext, selectSerial, selectSerial, setAlwaysPrepare, setDeleteStatementId, setDummyUpdateStatementId, setFields, setInsertStatementId, setModified, setSelectAllStatementId, setSelectExpiredTableSerials1StatementId, setSelectExpiredTableSerials2StatementId, setSelectLockedStatementId, setSelectSerialStatementId, setSelectStatementId, setTableSerial, setUpdateSerialAndTableSerialStatementId, setUpdateSerialStatementId, setUpdateStatementId, setUpdateTableSerialStatementId, sync, syncObject, toGenericString, toString, update, updateFieldCount, updateFields, updateObject, updatePlain, updateSerial, updateSerialAndTableSerial, updateTableSerial
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PartialDbObject

public PartialDbObject(DbObject 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: DbObject
Sets the logical db connection for this object.

Overrides:
setDb in class DbObject
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)

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