net.ontopia.persistence.proxy
Class AbstractRWPersistent

java.lang.Object
  extended by net.ontopia.persistence.proxy.AbstractRWPersistent
All Implemented Interfaces:
PersistentIF
Direct Known Subclasses:
TMObject

public abstract class AbstractRWPersistent
extends java.lang.Object
implements PersistentIF

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
protected  IdentityIF id
           
protected static int[] MASKS
           
protected  TransactionIF txn
           
 java.lang.Object[] values
           
 
Constructor Summary
AbstractRWPersistent()
           
AbstractRWPersistent(TransactionIF txn)
           
 
Method Summary
 IdentityIF _p_getIdentity()
          INTERNAL: Returns the identity of the object.
 TransactionIF _p_getTransaction()
          INTERNAL: Returns the transaction that is responible for managing the object.
 java.lang.Object _p_getType()
          INTERNAL: Returns the object.type.
 void _p_setIdentity(IdentityIF identity)
          INTERNAL: Sets the identity of the object.
 void _p_setTransaction(TransactionIF txn)
          INTERNAL: Sets the transaction that is responible for managing the object.
 java.lang.String _p_toString()
           
 void clearAll()
           
abstract  void detach()
           
protected  void detachCollectionField(int field)
           
protected  void detachField(int field)
           
protected  java.lang.Object executeQuery(java.lang.String name, java.lang.Object[] params)
           
protected  java.lang.Object getValue(int field)
           
 boolean isDeleted()
           
 boolean isDirty()
           
 boolean isDirty(int field)
           
 boolean isDirtyFlushed()
           
 boolean isDirtyFlushed(int field)
           
 boolean isInDatabase()
           
 boolean isLoaded(int field)
           
 boolean isNewObject()
           
 boolean isPersistent()
           
 boolean isTransient()
           
protected  java.util.Collection loadCollectionField(int field)
           
protected  java.lang.Object loadField(int field)
          INTERNAL: Called when the instance requests the initialization of the specified field value.
protected  java.lang.Object loadFieldNoCheck(int field)
           
 java.lang.Object loadValue(FieldInfoIF finfo)
           
 int nextDirty(int start)
           
 int nextDirty(int start, int end)
           
 int nextDirtyFlushed(int start)
           
 int nextDirtyFlushed(int start, int end)
           
 void setDeleted(boolean deleted)
           
 void setDirty(int field, boolean dirty)
           
 void setDirtyFlushed(int field, boolean dirty)
           
 void setInDatabase(boolean inDatabase)
           
 void setNewObject(boolean newObject)
           
 void setPersistent(boolean persistent)
           
protected  void setValue(int field, java.lang.Object value)
           
protected  void unsetValue(int field, java.lang.Object value)
           
protected  void valueAdded(int field, java.lang.Object value, boolean dchange)
           
protected  void valueChanged(int field, java.lang.Object value, boolean dchange)
          INTERNAL: Called when a field value has been changed.
protected  void valueRemoved(int field, java.lang.Object value, boolean dchange)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.ontopia.persistence.proxy.PersistentIF
_p_getFieldCount
 

Field Detail

id

protected IdentityIF id

txn

protected TransactionIF txn

MASKS

protected static final int[] MASKS

values

public java.lang.Object[] values
Constructor Detail

AbstractRWPersistent

public AbstractRWPersistent()

AbstractRWPersistent

public AbstractRWPersistent(TransactionIF txn)
Method Detail

_p_getIdentity

public IdentityIF _p_getIdentity()
Description copied from interface: PersistentIF
INTERNAL: Returns the identity of the object.

Specified by:
_p_getIdentity in interface PersistentIF

_p_getType

public java.lang.Object _p_getType()
Description copied from interface: PersistentIF
INTERNAL: Returns the object.type. This information is used by the transaction to handle the persistent mapping for the object.

Specified by:
_p_getType in interface PersistentIF

_p_setIdentity

public void _p_setIdentity(IdentityIF identity)
Description copied from interface: PersistentIF
INTERNAL: Sets the identity of the object.

Specified by:
_p_setIdentity in interface PersistentIF

_p_getTransaction

public TransactionIF _p_getTransaction()
Description copied from interface: PersistentIF
INTERNAL: Returns the transaction that is responible for managing the object.

Specified by:
_p_getTransaction in interface PersistentIF

_p_setTransaction

public void _p_setTransaction(TransactionIF txn)
Description copied from interface: PersistentIF
INTERNAL: Sets the transaction that is responible for managing the object.

Specified by:
_p_setTransaction in interface PersistentIF

loadField

protected java.lang.Object 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

protected java.lang.Object loadFieldNoCheck(int field)
                                     throws IdentityNotFoundException
Throws:
IdentityNotFoundException

loadCollectionField

protected java.util.Collection loadCollectionField(int field)

detach

public abstract void detach()
Specified by:
detach in interface PersistentIF

detachField

protected void detachField(int field)

detachCollectionField

protected void detachCollectionField(int field)

valueChanged

protected void valueChanged(int field,
                            java.lang.Object value,
                            boolean dchange)
INTERNAL: Called when a field value has been changed. The managing transaction will be notified.


valueAdded

protected void valueAdded(int field,
                          java.lang.Object value,
                          boolean dchange)

valueRemoved

protected void valueRemoved(int field,
                            java.lang.Object value,
                            boolean dchange)

executeQuery

protected java.lang.Object executeQuery(java.lang.String name,
                                        java.lang.Object[] params)

isTransient

public boolean isTransient()
Specified by:
isTransient in interface PersistentIF

isNewObject

public boolean isNewObject()
Specified by:
isNewObject in interface PersistentIF

setNewObject

public void setNewObject(boolean newObject)
Specified by:
setNewObject in interface PersistentIF

isInDatabase

public boolean isInDatabase()
Specified by:
isInDatabase in interface PersistentIF

setInDatabase

public void setInDatabase(boolean inDatabase)
Specified by:
setInDatabase in interface PersistentIF

isPersistent

public boolean isPersistent()
Specified by:
isPersistent in interface PersistentIF

setPersistent

public void setPersistent(boolean persistent)
Specified by:
setPersistent in interface PersistentIF

isDeleted

public boolean isDeleted()
Specified by:
isDeleted in interface PersistentIF

setDeleted

public void setDeleted(boolean deleted)
Specified by:
setDeleted in interface PersistentIF

isLoaded

public boolean isLoaded(int field)
Specified by:
isLoaded in interface PersistentIF

loadValue

public java.lang.Object loadValue(FieldInfoIF finfo)
Specified by:
loadValue in interface PersistentIF

getValue

protected java.lang.Object getValue(int field)

setValue

protected void setValue(int field,
                        java.lang.Object value)

unsetValue

protected void unsetValue(int field,
                          java.lang.Object value)

isDirty

public boolean isDirty()
Specified by:
isDirty in interface PersistentIF

isDirty

public boolean isDirty(int field)
Specified by:
isDirty in interface PersistentIF

nextDirty

public int nextDirty(int start)
Specified by:
nextDirty in interface PersistentIF

nextDirty

public int nextDirty(int start,
                     int end)
Specified by:
nextDirty in interface PersistentIF

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:
setDirtyFlushed in interface PersistentIF

clearAll

public void clearAll()
Specified by:
clearAll in interface PersistentIF

_p_toString

public java.lang.String _p_toString()


Copyright © 2000-2012 Ontopia.