org.apache.ojb.otm.swizzle
Class CopySwizzling

java.lang.Object
  extended byorg.apache.ojb.otm.swizzle.CopySwizzling
All Implemented Interfaces:
Swizzling

public class CopySwizzling
extends java.lang.Object
implements Swizzling

the new object data is copied into the existing object

Author:
Oleg Nitz

Constructor Summary
CopySwizzling()
           
 
Method Summary
 java.lang.Object getRealTarget(java.lang.Object swizzledObject)
          Get the real object associated with the given swizzled object.
 boolean isSameInstance(java.lang.Object swizzledObject, java.lang.Object object)
          Test if the given swizzled object is the same as the given object.
 java.lang.Object swizzle(java.lang.Object newObj, java.lang.Object oldObj, PersistenceBroker pb, ObjectCache cache)
          Swizzle object references.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CopySwizzling

public CopySwizzling()
Method Detail

swizzle

public java.lang.Object swizzle(java.lang.Object newObj,
                                java.lang.Object oldObj,
                                PersistenceBroker pb,
                                ObjectCache cache)
Description copied from interface: Swizzling
Swizzle object references.

Specified by:
swizzle in interface Swizzling
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
See Also:
Swizzling.swizzle(Object, Object, PersistenceBroker, ObjectCache)

isSameInstance

public boolean isSameInstance(java.lang.Object swizzledObject,
                              java.lang.Object object)
Description copied from interface: Swizzling
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.

Specified by:
isSameInstance in interface Swizzling
Parameters:
swizzledObject - The swizzled object
object - The other object to be compared to
Returns:
true, if they are the same. false, otherwise.
See Also:
Swizzling.isSameInstance(Object, Object)

getRealTarget

public java.lang.Object getRealTarget(java.lang.Object swizzledObject)
Description copied from interface: Swizzling
Get the real object associated with the given swizzled object.

Specified by:
getRealTarget in interface Swizzling
Parameters:
swizzledObject - the swizzled object
Returns:
the real object
See Also:
Swizzling.getRealTarget(Object)


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14