Package net.ontopia.persistence.proxy
Class AbstractRWPersistent
java.lang.Object
net.ontopia.persistence.proxy.AbstractRWPersistent
- All Implemented Interfaces:
PersistentIF
- Direct Known Subclasses:
TMObject
INTERNAL: An abstract PersistentIF implementation that handles most
of the machinery needed to implement persistent objects. Note that
other persistent classes should extend this class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IdentityIFprotected static final int[]protected TransactionIFObject[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionINTERNAL: Returns the identity of the object.INTERNAL: Returns the transaction that is responible for managing the object.Class<?>INTERNAL: Returns the object.type.void_p_setIdentity(IdentityIF identity) INTERNAL: Sets the identity of the object.voidINTERNAL: Sets the transaction that is responible for managing the object.voidclearAll()abstract voiddetach()protected voiddetachCollectionField(int field) protected voiddetachField(int field) protected ObjectexecuteQuery(String name, Object[] params) protected <F> FgetValue(int field) booleanbooleanisDirty()booleanisDirty(int field) booleanbooleanisDirtyFlushed(int field) booleanbooleanisLoaded(int field) booleanbooleanbooleanprotected <F> Collection<F>loadCollectionField(int field) protected <F> FloadField(int field) INTERNAL: Called when the instance requests the initialization of the specified field value.protected <F> FloadFieldNoCheck(int field) loadValue(FieldInfoIF finfo) intnextDirty(int start) intnextDirty(int start, int end) intnextDirtyFlushed(int start) intnextDirtyFlushed(int start, int end) voidsetDeleted(boolean deleted) voidsetDirty(int field, boolean dirty) voidsetDirtyFlushed(int field, boolean dirty) voidsetInDatabase(boolean inDatabase) voidsetNewObject(boolean newObject) voidsetPersistent(boolean persistent) protected voidabstract voidsyncAfterMerge(IdentityIF source, IdentityIF target) protected voidsyncFieldsAfterMerge(IdentityIF source, IdentityIF target, int... fields) protected voidunsetValue(int field, Object value) protected voidvalueAdded(int field, Object value, boolean dchange) protected voidvalueChanged(int field, Object value, boolean dchange) INTERNAL: Called when a field value has been changed.protected voidvalueRemoved(int field, Object value, boolean dchange) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.ontopia.persistence.proxy.PersistentIF
_p_getFieldCount
-
Field Details
-
id
-
txn
-
MASKS
protected static final int[] MASKS -
values
-
-
Constructor Details
-
AbstractRWPersistent
public AbstractRWPersistent() -
AbstractRWPersistent
-
-
Method Details
-
_p_getIdentity
Description copied from interface:PersistentIFINTERNAL: Returns the identity of the object.- Specified by:
_p_getIdentityin interfacePersistentIF
-
_p_getType
Description copied from interface:PersistentIFINTERNAL: Returns the object.type. This information is used by the transaction to handle the persistent mapping for the object.- Specified by:
_p_getTypein interfacePersistentIF
-
_p_setIdentity
Description copied from interface:PersistentIFINTERNAL: Sets the identity of the object.- Specified by:
_p_setIdentityin interfacePersistentIF
-
_p_getTransaction
Description copied from interface:PersistentIFINTERNAL: Returns the transaction that is responible for managing the object.- Specified by:
_p_getTransactionin interfacePersistentIF
-
_p_setTransaction
Description copied from interface:PersistentIFINTERNAL: Sets the transaction that is responible for managing the object.- Specified by:
_p_setTransactionin interfacePersistentIF
-
syncAfterMerge
-
syncFieldsAfterMerge
-
loadField
protected <F> F loadField(int field) INTERNAL: Called when the instance requests the initialization of the specified field value. This call will lead to the value being retrieved from the data repository if the instance is managed by a transaction, otherwise a default value will be set.- Returns:
- FIXME: only loaded values will be returned. if the default value is being set, the return value is null.
-
loadFieldNoCheck
- Throws:
IdentityNotFoundException
-
loadCollectionField
-
detach
public abstract void detach()- Specified by:
detachin interfacePersistentIF
-
detachField
protected void detachField(int field) -
detachCollectionField
protected void detachCollectionField(int field) -
valueChanged
INTERNAL: Called when a field value has been changed. The managing transaction will be notified. -
valueAdded
-
valueRemoved
-
executeQuery
-
isTransient
public boolean isTransient()- Specified by:
isTransientin interfacePersistentIF
-
isNewObject
public boolean isNewObject()- Specified by:
isNewObjectin interfacePersistentIF
-
setNewObject
public void setNewObject(boolean newObject) - Specified by:
setNewObjectin interfacePersistentIF
-
isInDatabase
public boolean isInDatabase()- Specified by:
isInDatabasein interfacePersistentIF
-
setInDatabase
public void setInDatabase(boolean inDatabase) - Specified by:
setInDatabasein interfacePersistentIF
-
isPersistent
public boolean isPersistent()- Specified by:
isPersistentin interfacePersistentIF
-
setPersistent
public void setPersistent(boolean persistent) - Specified by:
setPersistentin interfacePersistentIF
-
isDeleted
public boolean isDeleted()- Specified by:
isDeletedin interfacePersistentIF
-
setDeleted
public void setDeleted(boolean deleted) - Specified by:
setDeletedin interfacePersistentIF
-
isLoaded
public boolean isLoaded(int field) - Specified by:
isLoadedin interfacePersistentIF
-
loadValue
- Specified by:
loadValuein interfacePersistentIF
-
getValue
protected <F> F getValue(int field) -
setValue
-
unsetValue
-
isDirty
public boolean isDirty()- Specified by:
isDirtyin interfacePersistentIF
-
isDirty
public boolean isDirty(int field) - Specified by:
isDirtyin interfacePersistentIF
-
nextDirty
public int nextDirty(int start) - Specified by:
nextDirtyin interfacePersistentIF
-
nextDirty
public int nextDirty(int start, int end) - Specified by:
nextDirtyin interfacePersistentIF
-
setDirty
public void setDirty(int field, boolean dirty) -
isDirtyFlushed
public boolean isDirtyFlushed() -
isDirtyFlushed
public boolean isDirtyFlushed(int field) -
nextDirtyFlushed
public int nextDirtyFlushed(int start) -
nextDirtyFlushed
public int nextDirtyFlushed(int start, int end) -
setDirtyFlushed
public void setDirtyFlushed(int field, boolean dirty) - Specified by:
setDirtyFlushedin interfacePersistentIF
-
clearAll
public void clearAll()- Specified by:
clearAllin interfacePersistentIF
-
_p_toString
-