source code formatting.
[utils] / test / toplink-essentials / src / main / java / org / wamblee / support / persistence / toplink / ToplinkJpaCustomizer.java
1 /*
2  * SCJD assignment, URLyBird, Erik Brakkee.
3  * Candidate ID: sr1399267.
4  */
5 package org.wamblee.support.persistence.toplink;
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  * DOCUMENT ME!
17  *
18  * @author $author$
19  * @version $Revision$
20  */
21 public class ToplinkJpaCustomizer implements JpaCustomizer {
22 /**
23      * Creates a new ToplinkJpaCustomizer object.
24      */
25     public ToplinkJpaCustomizer() {
26         // Empty
27     }
28
29     /**
30      * DOCUMENT ME!
31      *
32      * @param aPersistenceUnit DOCUMENT ME!
33      * @param aJpaProperties DOCUMENT ME!
34      */
35     @Override
36     public void customize(PersistenceUnitDescription aPersistenceUnit,
37         Map<String, String> aJpaProperties) {
38         // Hack to make JNDI lookup of the datasource work with toplink
39         aJpaProperties.put("toplink.session.customizer",
40             JndiSessionCustomizer.class.getName());
41
42         // DDL generation for toplink
43         aJpaProperties.put("toplink.ddl-generation", "create-tables");
44     }
45
46     /**
47      * DOCUMENT ME!
48      *
49      * @return DOCUMENT ME!
50      */
51     @Override
52     public ITableFilterSimple getJpaTables() {
53         return new ToplinkTables();
54     }
55 }