--- /dev/null
+package org.wamblee.support.persistence.toplink;
+
+import java.util.Map;
+
+import org.dbunit.dataset.filter.ITableFilterSimple;
+import org.wamblee.support.persistence.JpaCustomizer;
+import org.wamblee.support.persistence.PersistenceUnitDescription;
+
+public class ToplinkJpaCustomizer implements JpaCustomizer {
+
+ public ToplinkJpaCustomizer() {
+ // Empty
+ }
+
+ @Override
+ public void customize(PersistenceUnitDescription aPersistenceUnit, Map<String, String> aJpaProperties) {
+ // Hack to make JNDI lookup of the datasource work with toplink
+ aJpaProperties.put("toplink.session.customizer", JndiSessionCustomizer.class
+ .getName());
+
+ // DDL generation for toplink
+ aJpaProperties.put("toplink.ddl-generation", "create-tables");
+ }
+
+ @Override
+ public ITableFilterSimple getJpaTables() {
+ return new ToplinkTables();
+ }
+
+}
--- /dev/null
+package org.wamblee.support.persistence.toplink;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.dbunit.dataset.DataSetException;
+import org.dbunit.dataset.filter.ITableFilterSimple;
+
+/**
+ * Toplink-specific tables.
+ */
+public class ToplinkTables implements ITableFilterSimple {
+
+ private static final List<String> TABLES = Arrays.asList(new String[] { "SEQUENCE" } );
+
+ public boolean accept(String aTableName) throws DataSetException {
+ return TABLES.contains(aTableName);
+ }
+
+}