public class ObjectEnvelope extends java.lang.Object implements ObjectModification, Image.ImageListener
INSERT, UPDATE
Constructor and Description |
---|
ObjectEnvelope(ObjectEnvelopeTable buffer,
Identity oid,
java.lang.Object obj,
boolean isNewObject)
Create a wrapper by providing an Object.
|
Modifier and Type | Method and Description |
---|---|
void |
addedOneToOne(ObjectReferenceDescriptor ord,
java.lang.Object refObjOrProxy,
Identity oid) |
void |
addedXToN(CollectionDescriptor cod,
java.lang.Object refObjOrProxy,
Identity oid) |
void |
afterAbort()
Method declaration
|
void |
afterCommit()
Method declaration
|
void |
beforeAbort()
Method declaration
|
void |
beforeCommit()
We need to implement the Two-Phase Commit
protocol.
|
void |
cleanup(boolean reuse,
boolean wasInsert)
This method should be called before transaction ends
to allow cleanup of used resources, e.g.
|
void |
deletedOneToOne(ObjectReferenceDescriptor ord,
java.lang.Object refObjOrProxy,
Identity oid,
boolean needsUnlink) |
void |
deletedXToN(CollectionDescriptor cod,
java.lang.Object refObjOrProxy,
Identity oid) |
void |
doDelete() |
void |
doEvictFromCache() |
void |
doInsert() |
void |
doUpdate() |
java.util.Map |
getBeforeImage() |
PersistenceBrokerInternal |
getBroker() |
java.util.Map |
getCurrentImage() |
Identity |
getIdentity() |
org.apache.ojb.odmg.states.ModificationState |
getModificationState()
Returns the Modification-state.
|
java.lang.Object |
getObject()
Returns the managed materialized object.
|
java.lang.Object |
getRealObject() |
boolean |
hasChanged(PersistenceBroker broker)
For internal use only! Only call immediately before commit to guarantee
that all changes can be detected (because this method cache the detected "change state"
thus on eager call changes could be ignored).
|
boolean |
isDeleted(Identity id)
Checks if the object with the given identity has been deleted
within the transaction.
|
boolean |
isWriteLocked() |
boolean |
needsDelete()
Returns true if the underlying Object needs an UPDATE statement, else returns false.
|
boolean |
needsInsert()
Returns true if the underlying Object needs an INSERT statement, else returns false.
|
boolean |
needsUpdate()
Returns true if the underlying Object needs an UPDATE statement, else returns false.
|
Identity |
refreshIdentity()
Replace the current with a new generated identity object and
returns the old one.
|
void |
refreshObjectIfNeeded(java.lang.Object obj) |
void |
setModificationState(org.apache.ojb.odmg.states.ModificationState newModificationState)
set the Modification state to a new value.
|
void |
setWriteLocked(boolean writeLocked) |
java.lang.String |
toString()
returns a String representation.
|
public ObjectEnvelope(ObjectEnvelopeTable buffer, Identity oid, java.lang.Object obj, boolean isNewObject)
public PersistenceBrokerInternal getBroker()
getBroker
in interface Image.ImageListener
public java.util.Map getBeforeImage()
public java.util.Map getCurrentImage()
public void cleanup(boolean reuse, boolean wasInsert)
public Identity refreshIdentity()
public Identity getIdentity()
public java.lang.Object getObject()
public java.lang.Object getRealObject()
public void refreshObjectIfNeeded(java.lang.Object obj)
public void beforeCommit()
public void afterCommit()
public void beforeAbort()
public void afterAbort()
public org.apache.ojb.odmg.states.ModificationState getModificationState()
public boolean needsInsert()
needsInsert
in interface ObjectModification
public boolean needsUpdate()
needsUpdate
in interface ObjectModification
public boolean needsDelete()
public boolean isDeleted(Identity id)
id
- The identityPersistenceBrokerException
public void setModificationState(org.apache.ojb.odmg.states.ModificationState newModificationState)
newModificationState
- org.apache.ojb.server.states.ModificationStatepublic java.lang.String toString()
toString
in class java.lang.Object
public boolean hasChanged(PersistenceBroker broker)
public void doUpdate()
public void doInsert()
public void doDelete()
public void doEvictFromCache()
public boolean isWriteLocked()
public void setWriteLocked(boolean writeLocked)
public void addedOneToOne(ObjectReferenceDescriptor ord, java.lang.Object refObjOrProxy, Identity oid)
addedOneToOne
in interface Image.ImageListener
public void deletedOneToOne(ObjectReferenceDescriptor ord, java.lang.Object refObjOrProxy, Identity oid, boolean needsUnlink)
deletedOneToOne
in interface Image.ImageListener
public void addedXToN(CollectionDescriptor cod, java.lang.Object refObjOrProxy, Identity oid)
addedXToN
in interface Image.ImageListener
public void deletedXToN(CollectionDescriptor cod, java.lang.Object refObjOrProxy, Identity oid)
deletedXToN
in interface Image.ImageListener
(C) 2002 - 2005 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30