5ba15e840ba1d0163dab7bad3fcacfe920c3e71a
[utils] /
1 package org.wamblee.support.persistence.toplink;
2
3 import java.util.Map;
4
5 import org.dbunit.dataset.filter.ITableFilterSimple;
6 import org.wamblee.support.persistence.JpaCustomizer;
7 import org.wamblee.support.persistence.PersistenceUnitDescription;
8
9 public class ToplinkJpaCustomizer implements JpaCustomizer {
10
11     public ToplinkJpaCustomizer() { 
12         // Empty
13     }
14     
15     @Override
16     public void customize(PersistenceUnitDescription aPersistenceUnit, Map<String, String> aJpaProperties) {
17         // Hack to make JNDI lookup of the datasource work with toplink
18         aJpaProperties.put("toplink.session.customizer", JndiSessionCustomizer.class
19                 .getName());
20         
21         // DDL generation for toplink
22         aJpaProperties.put("toplink.ddl-generation", "create-tables");   
23     }
24     
25     @Override
26     public ITableFilterSimple getJpaTables() {
27         return new ToplinkTables();
28     }
29
30 }