Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortle2008-04-23 21:17:56 +0000
committertle2008-04-23 21:17:56 +0000
commitd7558f92c88f3aa7390e19fb4399723eeb8543f1 (patch)
tree2b31201b2aba7b019f7a334c9840b12252211d21
parent8dde87d69332539c7c55b7f34bfe1fdfabd999a7 (diff)
downloadwebtools.dali-d7558f92c88f3aa7390e19fb4399723eeb8543f1.tar.gz
webtools.dali-d7558f92c88f3aa7390e19fb4399723eeb8543f1.tar.xz
webtools.dali-d7558f92c88f3aa7390e19fb4399723eeb8543f1.zip
Changed to EclipseLink.
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/src/org/eclipse/jpt/eclipselink/core/ddlgen/Main.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/lib/org.eclipse.jpt.eclipselink.core.ddlgen.jarbin3589 -> 3788 bytes
2 files changed, 37 insertions, 8 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/src/org/eclipse/jpt/eclipselink/core/ddlgen/Main.java b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/src/org/eclipse/jpt/eclipselink/core/ddlgen/Main.java
index 667b8d58d8..c20f38a33b 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/src/org/eclipse/jpt/eclipselink/core/ddlgen/Main.java
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/src/org/eclipse/jpt/eclipselink/core/ddlgen/Main.java
@@ -21,7 +21,7 @@ import java.util.Map.Entry;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
-import oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider;
+import org.eclipse.persistence.jpa.config.PersistenceUnitProperties;
/**
* This class creates a EclipseLink <code>EntityManagerFactory</code>,
@@ -96,17 +96,17 @@ public class Main
this.eclipseLinkPropertiesPath = this.getEclipseLinkPropertiesPath(args);
this.eclipseLinkProperties = this.getProperties(this.eclipseLinkPropertiesPath);
- this.createDDLFileName = EntityManagerFactoryProvider.getConfigPropertyAsString(
- EntityManagerFactoryProvider.CREATE_JDBC_DDL_FILE,
+ this.createDDLFileName = this.getConfigPropertyAsString(
+ PersistenceUnitProperties.CREATE_JDBC_DDL_FILE,
this.eclipseLinkProperties,
- EntityManagerFactoryProvider.DEFAULT_CREATE_JDBC_FILE_NAME);
+ PersistenceUnitProperties.DEFAULT_CREATE_JDBC_FILE_NAME);
- this.dropDDLFileName = EntityManagerFactoryProvider.getConfigPropertyAsString(
- EntityManagerFactoryProvider.DROP_JDBC_DDL_FILE,
+ this.dropDDLFileName = this.getConfigPropertyAsString(
+ PersistenceUnitProperties.DROP_JDBC_DDL_FILE,
this.eclipseLinkProperties,
- EntityManagerFactoryProvider.DEFAULT_DROP_JDBC_FILE_NAME);
+ PersistenceUnitProperties.DEFAULT_DROP_JDBC_FILE_NAME);
- this.appLocation = this.eclipseLinkProperties.get(EntityManagerFactoryProvider.APP_LOCATION);
+ this.appLocation = this.eclipseLinkProperties.get(PersistenceUnitProperties.APP_LOCATION);
this.isDebugMode = this.getDebugMode(args);
}
@@ -185,4 +185,33 @@ public class Main
}
return false;
}
+
+ // ****** utility methods *******
+
+ /**
+ * Check the provided map for an object with the given key. If that object is not available, check the
+ * System properties. If it is not available from either location, return the default value.
+ * @param propertyKey
+ * @param map
+ * @param defaultValue
+ * @return
+ */
+ protected String getConfigPropertyAsString(String propertyKey, Map<String, String> overrides, String defaultValue){
+ String value = this.getConfigPropertyAsString(propertyKey, overrides);
+ if (value == null){
+ value = defaultValue;
+ }
+ return value;
+ }
+
+ protected String getConfigPropertyAsString(String propertyKey, Map<String, String> overrides){
+ String value = null;
+ if (overrides != null){
+ value = (String)overrides.get(propertyKey);
+ }
+ if (value == null){
+ value = System.getProperty(propertyKey);
+ }
+ return value;
+ }
}
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/lib/org.eclipse.jpt.eclipselink.core.ddlgen.jar b/jpa/plugins/org.eclipse.jpt.eclipselink.core/lib/org.eclipse.jpt.eclipselink.core.ddlgen.jar
index 82f0e339e5..d66e9dad69 100644
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/lib/org.eclipse.jpt.eclipselink.core.ddlgen.jar
+++ b/jpa/plugins/org.eclipse.jpt.eclipselink.core/lib/org.eclipse.jpt.eclipselink.core.ddlgen.jar
Binary files differ

Back to the top