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;
* @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.
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());
*/
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.
*
*/
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) {