--- /dev/null
+package org.wamblee.support.persistence.hibernate;
+
+import java.util.Map;
+
+import org.dbunit.dataset.filter.ITableFilterSimple;
+import org.wamblee.support.persistence.JpaCustomizer;
+import org.wamblee.support.persistence.PersistenceUnitDescription;
+
+public class HibernateJpaCustomizer implements JpaCustomizer {
+
+ public HibernateJpaCustomizer() {
+ // Empty
+ }
+
+ @Override
+ public void customize(PersistenceUnitDescription aPersistenceUnit, Map<String, String> aJpaProperties) {
+ // Hibernate: Override transaction type and datasource
+ aJpaProperties.put("javax.persistence.transactionType", "RESOURCE_LOCAL");
+ aJpaProperties.put("javax.persistence.jtaDataSource", null);
+ aJpaProperties.put("javax.persistence.nonJtaDataSource", aPersistenceUnit.getJndiName());
+
+ // Hibernate schema generation
+ aJpaProperties.put("hibernate.hbm2ddl.auto", "create");
+ }
+
+ @Override
+ public ITableFilterSimple getJpaTables() {
+ return new HibernateTables();
+ }
+
+}
--- /dev/null
+package org.wamblee.support.persistence.hibernate;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.dbunit.dataset.DataSetException;
+import org.dbunit.dataset.filter.ITableFilterSimple;
+
+/**
+ * Toplink-specific tables.
+ */
+public class HibernateTables implements ITableFilterSimple {
+
+ private static final List<String> TABLES = Arrays.asList(new String[] { "" } );
+
+ public boolean accept(String aTableName) throws DataSetException {
+ return TABLES.contains(aTableName);
+ }
+
+}