org.apache.ojb.otm.swizzle
Interface Swizzling

All Known Implementing Classes:
CopySwizzling, NoSwizzling

public interface Swizzling


Method Summary
 Object getRealTarget(Object swizzledObject)
          Get the real object associated with the given swizzled object.
 boolean isSameInstance(Object swizzledObject, Object object)
          Test if the given swizzled object is the same as the given object.
 Object swizzle(Object newObj, Object oldObj, PersistenceBroker pb, ObjectCache cache)
          Swizzle object references.
 

Method Detail

swizzle

Object swizzle(Object newObj,
               Object oldObj,
               PersistenceBroker pb,
               ObjectCache cache)
Swizzle object references.

Parameters:
newObj - the object being inserted into the EditingContext, is null if the object is being invalidated
oldObj - the object present in the EditingContext, is null if no object is present
pb - the PersistenceBroker that is used to get persistent class info
cache - the "cache" of old objects, only lookup() method can be used by the Swizzling implementation to seek for old objects that should be set as a new value of relations.
Returns:
the Swizzled Object

isSameInstance

boolean isSameInstance(Object swizzledObject,
                       Object object)
Test if the given swizzled object is the same as the given object. By same object we mean, that the System.identityHashCode() of the given object is the same as that of the object represented by the swizzled object.

Parameters:
swizzledObject - The swizzled object
object - The other object to be compared to
Returns:
true, if they are the same. false, otherwise.

getRealTarget

Object getRealTarget(Object swizzledObject)
Get the real object associated with the given swizzled object.

Parameters:
swizzledObject - the swizzled object
Returns:
the real object


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.