28c2e56e4be42706c74a4ef9d3414a943abcc1c7
[utils] /
1 /*
2  * SCJD assignment, URLyBird, Erik Brakkee.
3  * Candidate ID: sr1399267.
4  */
5 package org.wamblee.support.persistence.eclipselink;
6
7 import org.dbunit.dataset.filter.ITableFilterSimple;
8
9 import org.wamblee.support.persistence.JpaCustomizer;
10 import org.wamblee.support.persistence.PersistenceUnitDescription;
11
12 import java.util.Map;
13
14 /**
15  * 
16  * @author $author$
17  * @version $Revision$
18  */
19 public class EclipselinkJpaCustomizer implements JpaCustomizer {
20     /**
21      * Creates a new EclipselinkJpaCustomizer object.
22      */
23     public EclipselinkJpaCustomizer() {
24         // Empty
25     }
26
27     @Override
28     public void customize(PersistenceUnitDescription aPersistenceUnit,
29         Map<String, String> aJpaProperties) {
30         // Hack to make JNDI lookup of the datasource work with toplink
31         aJpaProperties.put("eclipselink.session.customizer",
32             JndiSessionCustomizer.class.getName());
33
34         // DDL generation for toplink
35         aJpaProperties.put("eclipselink.ddl-generation", "create-tables");
36     }
37
38     @Override
39     public ITableFilterSimple getJpaTables() {
40         return new EclipselinkTables();
41     }
42 }