Now using connections managed by JPA instead of using JNDI mocking.
[utils] / test / toplink-essentials / src / main / java / org / wamblee / support / persistence / toplink / ToplinkJpaCustomizer.java
index 3a132da20c54065934edda98f23e86adb7b87e11..1b3808f099cf07ff3c2c4f86eab53cb80dbd364a 100644 (file)
@@ -39,16 +39,15 @@ public class ToplinkJpaCustomizer implements JpaCustomizer {
     @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());
+
+        // Custom datasource properties.
+        aJpaProperties.put("toplink.jdbc.url", aJpaProperties.get("javax.persistence.jdbc.url"));
+        aJpaProperties.put("toplink.jdbc.user", aJpaProperties.get("javax.persistence.jdbc.user"));
+        aJpaProperties.put("toplink.jdbc.password", aJpaProperties.get("javax.persistence.jdbc.password"));
 
         // DDL generation for toplink
         aJpaProperties.put("toplink.ddl-generation", "create-tables");
         
-        // Use JTA transaction type
-        aJpaProperties.put("javax.persistence.transactionType", "JTA");
-        
         // DDL generation
         FileSystemUtils.createDir(new File("target/sql"));
         aJpaProperties.put("toplink.create-ddl-jdbc-file-name", "target/sql/create-schema.sql");