|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xorm.ObjectState | +--org.xorm.InterfaceInvocationHandler
Handles calls to an interface of the object model. The interface may be defined as a Java interface or a Java abstract class. This class ties the notion of an object with state (ObjectState) with the concept of the XORM Datastore Row.
Field Summary | |
protected Object |
proxy
|
protected byte |
status
|
static byte |
STATUS_DELETED
|
static byte |
STATUS_DIRTY
|
static byte |
STATUS_HOLLOW
|
static byte |
STATUS_NEW
|
static byte |
STATUS_PERSISTENT
|
static byte |
STATUS_PERSISTENT_CLEAN
|
static byte |
STATUS_PERSISTENT_DELETED
|
static byte |
STATUS_PERSISTENT_DIRTY
|
static byte |
STATUS_PERSISTENT_NEW
|
static byte |
STATUS_PERSISTENT_NEW_DELETED
|
static byte |
STATUS_PERSISTENT_NONTRANSACTIONAL
|
static byte |
STATUS_TRANSACTIONAL
|
static byte |
STATUS_TRANSIENT
|
static byte |
STATUS_TRANSIENT_CLEAN
|
static byte |
STATUS_TRANSIENT_DIRTY
|
Constructor Summary | |
InterfaceInvocationHandler(InterfaceManagerFactory factory,
ClassMapping mapping,
Row row)
|
Method Summary | |
int |
compareTo(InterfaceInvocationHandler other)
|
boolean |
dependsOn(InterfaceInvocationHandler other)
Returns true if any of the references from this object resolve to the object supplied as a parameter. |
void |
enterTransaction(TransactionImpl txn)
This is the only method where the txn field gets set. |
boolean |
exitTransaction(boolean commit)
|
ClassMapping |
getClassMapping()
The ClassMapping that describes how the proxy data translates into the datastore Row. |
static InterfaceInvocationHandler |
getHandler(Object object)
Gets the InterfaceInvocationHandler associated with the object. |
org.xorm.InterfaceManager |
getInterfaceManager()
The InterfaceManager that is managing this proxy. |
Object |
getObjectId()
|
Object |
getProxy()
|
Row |
getRow()
Initializes or retrieves the working Row. |
byte |
getStatus()
|
String |
getStatusName()
|
Object |
intercept(Object proxy,
Method method,
Object[] args,
net.sf.cglib.MethodProxy methodProxy)
This method is invoked after execution, or in the case of abstract or interface methods, instead of. |
Object |
invokeGet(String field,
ClassMapping returnTypeMapping,
Class returnType)
Returns the object associated with the given field that is of the given return type. |
boolean |
isDeleted()
|
boolean |
isDirty()
|
boolean |
isHollow()
|
boolean |
isNew()
|
boolean |
isPersistent()
|
boolean |
isTransactional()
|
void |
makeDirty()
|
void |
makePersistent(org.xorm.InterfaceManager mgr)
Marks this object and all the objects it contains as persistent (persistence by reachability). |
void |
notifyIDChanged(Object oldID,
Object newID)
|
void |
refresh(org.xorm.InterfaceManager mgr)
|
void |
refreshObjectId()
|
void |
setDeleted(boolean value)
|
void |
setDirty(boolean value)
|
void |
setHollow(boolean value)
|
void |
setNew(boolean value)
|
void |
setPersistent(boolean value)
|
void |
setProxy(Object proxy)
|
void |
setRow(Row newRow)
Sets the working Row. |
void |
setStatus(byte status)
|
void |
setTransactional(boolean value)
|
void |
snapshot()
Clones the current backing row for use in case of rollback. |
String |
toString()
Returns a debug representation of this handler, in the format [org.xorm.InterfaceInvocationHandler@xxxxxx; interface com.xyz.model.MyClass, primaryKey: {id}, status: PERSISTENT_CLEAN] |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte STATUS_TRANSACTIONAL
public static final byte STATUS_DIRTY
public static final byte STATUS_PERSISTENT
public static final byte STATUS_NEW
public static final byte STATUS_DELETED
public static final byte STATUS_HOLLOW
public static final byte STATUS_TRANSIENT
public static final byte STATUS_TRANSIENT_CLEAN
public static final byte STATUS_TRANSIENT_DIRTY
public static final byte STATUS_PERSISTENT_NONTRANSACTIONAL
public static final byte STATUS_PERSISTENT_CLEAN
public static final byte STATUS_PERSISTENT_DIRTY
public static final byte STATUS_PERSISTENT_NEW
public static final byte STATUS_PERSISTENT_DELETED
public static final byte STATUS_PERSISTENT_NEW_DELETED
protected byte status
protected Object proxy
Constructor Detail |
public InterfaceInvocationHandler(InterfaceManagerFactory factory, ClassMapping mapping, Row row)
Method Detail |
public static InterfaceInvocationHandler getHandler(Object object)
public org.xorm.InterfaceManager getInterfaceManager()
public ClassMapping getClassMapping()
public void enterTransaction(TransactionImpl txn)
public boolean exitTransaction(boolean commit)
public void makeDirty()
public void makePersistent(org.xorm.InterfaceManager mgr)
public void notifyIDChanged(Object oldID, Object newID)
public int compareTo(InterfaceInvocationHandler other)
public boolean dependsOn(InterfaceInvocationHandler other)
public Object getObjectId()
public void refreshObjectId()
public void refresh(org.xorm.InterfaceManager mgr)
public void snapshot()
public Row getRow()
public void setRow(Row newRow)
public String toString()
toString
in class Object
public Object intercept(Object proxy, Method method, Object[] args, net.sf.cglib.MethodProxy methodProxy) throws Throwable
intercept
in interface net.sf.cglib.MethodInterceptor
proxy
- thismethod
- Methodargs
- Arg arraymethodProxy
- the MethodProxy
Throwable
- any exceptionpublic Object invokeGet(String field, ClassMapping returnTypeMapping, Class returnType)
public final String getStatusName()
public boolean isDirty()
public void setDirty(boolean value)
public boolean isTransactional()
public void setTransactional(boolean value)
public boolean isPersistent()
public void setPersistent(boolean value)
public boolean isNew()
public void setNew(boolean value)
public boolean isDeleted()
public void setDeleted(boolean value)
public boolean isHollow()
public void setHollow(boolean value)
public void setStatus(byte status)
public byte getStatus()
public void setProxy(Object proxy)
public Object getProxy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |