diff options
author | kmoore | 2012-01-06 20:28:43 +0000 |
---|---|---|
committer | kmoore | 2012-01-06 20:28:43 +0000 |
commit | b1fc0e01c6163aab06ae2b8040db559b3da61244 (patch) | |
tree | bff0a2ba865d39eb4cf4a4450097838ad562d5ac | |
parent | 9e1be6215f7a5b347a34e7774e8cb6df7c9b510e (diff) | |
download | webtools.dali-b1fc0e01c6163aab06ae2b8040db559b3da61244.tar.gz webtools.dali-b1fc0e01c6163aab06ae2b8040db559b3da61244.tar.xz webtools.dali-b1fc0e01c6163aab06ae2b8040db559b3da61244.zip |
363306 - [EclipseLink] sql-script generation deletes the generated files
-rw-r--r-- | jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/src/org/eclipse/jpt/jpa/eclipselink/core/ddlgen/Main.java | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/src/org/eclipse/jpt/jpa/eclipselink/core/ddlgen/Main.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/src/org/eclipse/jpt/jpa/eclipselink/core/ddlgen/Main.java index 82c382eefc..0376d159c0 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/src/org/eclipse/jpt/jpa/eclipselink/core/ddlgen/Main.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/src/org/eclipse/jpt/jpa/eclipselink/core/ddlgen/Main.java @@ -1,5 +1,5 @@ /******************************************************************************* -* Copyright (c) 2007, 2011 Oracle. All rights reserved. +* Copyright (c) 2007, 2012 Oracle. All rights reserved. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0, which accompanies this distribution * and is available at http://www.eclipse.org/legal/epl-v10.html. @@ -52,9 +52,6 @@ public class Main { protected EntityManagerFactory emf; private Map<String, String> eclipseLinkProperties; - private String createDDLFileName; - private String dropDDLFileName; - private String appLocation; private String eclipseLinkPropertiesPath; private boolean isDebugMode; @@ -94,19 +91,6 @@ public class Main this.eclipseLinkPropertiesPath = this.getEclipseLinkPropertiesPath(args); this.eclipseLinkProperties = this.getProperties(this.eclipseLinkPropertiesPath); - - this.createDDLFileName = this.getConfigPropertyAsString( - SchemaGeneration.ECLIPSELINK_CREATE_FILE_NAME, - this.eclipseLinkProperties, - SchemaGeneration.DEFAULT_SCHEMA_GENERATION_CREATE_FILE_NAME); - - this.dropDDLFileName = this.getConfigPropertyAsString( - SchemaGeneration.ECLIPSELINK_DROP_FILE_NAME, - this.eclipseLinkProperties, - SchemaGeneration.DEFAULT_SCHEMA_GENERATION_DROP_FILE_NAME); - - this.appLocation = this.eclipseLinkProperties.get( - SchemaGeneration.ECLIPSELINK_APPLICATION_LOCATION); this.isDebugMode = this.getDebugMode(args); } @@ -114,8 +98,6 @@ public class Main private void dispose() { if( ! this.isDebugMode) { - new File(this.appLocation + "/" + this.createDDLFileName).delete(); //$NON-NLS-1$ - new File(this.appLocation + "/" + this.dropDDLFileName).delete(); //$NON-NLS-1$ new File(this.eclipseLinkPropertiesPath).delete(); } } @@ -186,33 +168,4 @@ 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 = overrides.get(propertyKey); - } - if(value == null) { - value = System.getProperty(propertyKey); - } - return value; - } } |