(no commit message)
authorErik Brakkee <erik@brakkee.org>
Thu, 22 Jul 2010 11:54:15 +0000 (11:54 +0000)
committerErik Brakkee <erik@brakkee.org>
Thu, 22 Jul 2010 11:54:15 +0000 (11:54 +0000)
support/spring/src/main/java/org/wamblee/persistence/hibernate/HibernateSupport.java
support/spring/src/test/java/org/wamblee/test/spring/HibernateUtils.java

index 52dbc352b742a8ea2c0552b4b454dccc2b164bfd..8eb7790bbf3e0d02fb607983945c7ad5c4a6375d 100644 (file)
@@ -22,9 +22,8 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.Map.Entry;
+import java.util.logging.Logger;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.springframework.orm.hibernate3.HibernateTemplate;
 import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
 import org.wamblee.persistence.Persistent;
@@ -36,7 +35,7 @@ import org.wamblee.persistence.Persistent;
  * @author Erik Brakkee
  */
 public class HibernateSupport extends HibernateDaoSupport {
-    private static final Log LOG = LogFactory.getLog(HibernateSupport.class);
+    private static final Logger LOG = Logger.getLogger(HibernateSupport.class.getName());
 
     /**
      * Constructs the object.
@@ -111,11 +110,11 @@ public class HibernateSupport extends HibernateDaoSupport {
 
         aProcessed.add(elem);
 
-        LOG.debug("Setting pk/version on " + aPersistent + " from " + aMerged);
+        LOG.fine("Setting pk/version on " + aPersistent + " from " + aMerged);
 
         if ((aPersistent.getPrimaryKey() != null) &&
             !aMerged.getPrimaryKey().equals(aPersistent.getPrimaryKey())) {
-            LOG.error("Mismatch between primary key values: " + aPersistent +
+            LOG.warning("Mismatch between primary key values: " + aPersistent +
                 " " + aMerged);
         } else {
             aPersistent.setPersistedVersion(aMerged.getPersistedVersion());
index a370a4046d0c4ee7a103220680e871a6bd3dbe7c..edefc37369c9e97be39e65c96a99ec011c1966de 100644 (file)
  */ 
 package org.wamblee.test.spring;
 
-import org.apache.oro.io.AwkFilenameFilter;
-
-import org.hibernate.cfg.Configuration;
-
-import org.wamblee.io.ClassPathResource;
-import org.wamblee.io.InputResource;
-
 import java.io.File;
 import java.io.FileFilter;
 import java.io.IOException;
-
 import java.util.Map;
 import java.util.Properties;
 import java.util.TreeMap;
 
+import org.hibernate.cfg.Configuration;
+import org.wamblee.io.ClassPathResource;
+import org.wamblee.io.InputResource;
+import org.wamblee.io.RegexFilenameFilter;
+
 /**
  * Hibernate utilities.
  * 
@@ -55,7 +52,7 @@ public final class HibernateUtils {
      */
     public static Configuration getConfiguration(File aDir) throws IOException {
         Configuration conf = new Configuration();
-        File[] files = aDir.listFiles((FileFilter) (new AwkFilenameFilter(
+        File[] files = aDir.listFiles((FileFilter) (new RegexFilenameFilter(
             ".*\\.hbm\\.xml")));
 
         for (File f : files) {