From: Erik Brakkee Date: Sat, 31 Jul 2010 12:54:03 +0000 (+0000) Subject: (no commit message) X-Git-Tag: wamblee-utils-0.7~132 X-Git-Url: http://wamblee.org/gitweb/?a=commitdiff_plain;ds=inline;h=c76354d4e0a704ab2cb140b2da4707a44eadc10a;hp=150369124953929a3c286d1607b7984120b96cb9;p=utils --- diff --git a/support/general/src/main/java/org/wamblee/persistence/JpaMergeSupport.java b/support/general/src/main/java/org/wamblee/persistence/JpaMergeSupport.java index 5105d767..f82f8255 100644 --- a/support/general/src/main/java/org/wamblee/persistence/JpaMergeSupport.java +++ b/support/general/src/main/java/org/wamblee/persistence/JpaMergeSupport.java @@ -28,6 +28,7 @@ import java.util.logging.Logger; import javax.persistence.EntityManager; +import org.wamblee.general.ObjectElem; import org.wamblee.reflection.ReflectionUtils; /** @@ -284,33 +285,4 @@ public class JpaMergeSupport { processPersistent(mergedValue, persistentValue, aProcessed); } } - - /** - * This class provided an equality operation based on the object reference - * of the wrapped object. This is required because we cannto assume that the - * equals operation has any meaning for different types of persistent - * objects. This allows us to use the standard collection classes for - * detecting cyclic dependences and avoiding recursion. - */ - private static final class ObjectElem { - private Object object; - - public ObjectElem(Object aObject) { - object = aObject; - } - - public boolean equals(Object aObj) { - if (aObj == null) { - return false; - } - if (!(aObj instanceof ObjectElem)) { - return false; - } - return ((ObjectElem) aObj).object == object; - } - - public int hashCode() { - return object.hashCode(); - } - } }