(no commit message)
[utils] / support / general / src / main / java / org / wamblee / persistence / JpaMergeSupport.java
index 4254dad6649820ad5c8d2ee295c245ec2e40e09e..f82f8255d0ba7f542475a37973ef343f4487a459 100644 (file)
@@ -24,11 +24,11 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.Map.Entry;
+import java.util.logging.Logger;
 
 import javax.persistence.EntityManager;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.wamblee.general.ObjectElem;
 import org.wamblee.reflection.ReflectionUtils;
 
 /**
@@ -54,7 +54,7 @@ import org.wamblee.reflection.ReflectionUtils;
  * @author Erik Brakkee
  */
 public class JpaMergeSupport {
-    private static final Log LOG = LogFactory.getLog(JpaMergeSupport.class);
+    private static final Logger LOG = Logger.getLogger(JpaMergeSupport.class.getName());
 
     /**
      * Constructs the object.
@@ -112,7 +112,7 @@ public class JpaMergeSupport {
 
         aProcessed.add(elem);
 
-        LOG.debug("Setting pk/version on " + aPersistent + " from " + aMerged);
+        LOG.fine("Setting pk/version on " + aPersistent + " from " + aMerged);
 
         Persistent persistentWrapper = PersistentFactory.create(aPersistent);
         Persistent mergedWrapper = PersistentFactory.create(aMerged);
@@ -285,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();
-        }
-    }
 }