856b051986174e08c1c03840bafaea8a22609d4d
[utils] / test / eclipselink / src / main / java / org / wamblee / support / persistence / eclipselink / EclipselinkJpaCustomizer.java
1 package org.wamblee.support.persistence.eclipselink;
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 EclipselinkJpaCustomizer implements JpaCustomizer {
10
11     public EclipselinkJpaCustomizer() { 
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("eclipselink.session.customizer", JndiSessionCustomizer.class
19                 .getName());
20         
21         // DDL generation for toplink
22         aJpaProperties.put("eclipselink.ddl-generation", "create-tables");   
23     }
24     
25     @Override
26     public ITableFilterSimple getJpaTables() {
27         return new EclipselinkTables();
28     }
29
30 }