Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpfullbright2008-05-09 20:10:13 +0000
committerpfullbright2008-05-09 20:10:13 +0000
commit43824e5debb689fa157bee57eaa0bd4cfa814c72 (patch)
treeabede6be8accd0dd0187db4daf2c63eabdca0c2b
parentba3f0e9d79d3fae03325c0eb2c93a0ba196f30a1 (diff)
downloadwebtools.dali-43824e5debb689fa157bee57eaa0bd4cfa814c72.tar.gz
webtools.dali-43824e5debb689fa157bee57eaa0bd4cfa814c72.tar.xz
webtools.dali-43824e5debb689fa157bee57eaa0bd4cfa814c72.zip
[Bug 229891] - Default schema project preference stored in different place than connection profile name
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java66
1 files changed, 35 insertions, 31 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java
index e957c69312..317c8959cc 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/JptCorePlugin.java
@@ -71,13 +71,6 @@ public class JptCorePlugin extends Plugin {
public static final String JPA_PLATFORM = PLUGIN_ID + ".platform"; //$NON-NLS-1$
/**
- * The key for storing a JPA project's user overridden default schema name
- * in the Eclipse project's preferences.
- */
- public static final String USER_OVERRIDE_DEFAULT_SCHEMA_NAME =
- PLUGIN_ID + ".userOverrideDefaultSchemaName"; //$NON-NLS-1$
-
- /**
* The key for storing a JPA project's "discover" flag in the Eclipse
* project's preferences.
*/
@@ -85,12 +78,19 @@ public class JptCorePlugin extends Plugin {
/**
* The key for storing a JPA project's data source connection profile name
- * in the Eclipse project's persistent property's.
+ * in the Eclipse project's persistent properties.
*/
public static final QualifiedName DATA_SOURCE_CONNECTION_PROFILE_NAME =
new QualifiedName(PLUGIN_ID, "dataSource.connectionProfileName"); //$NON-NLS-1$
/**
+ * The key for storing a JPA project's user overridden default schema name
+ * in the Eclipse project's persistent properties.
+ */
+ public static final QualifiedName USER_OVERRIDE_DEFAULT_SCHEMA_NAME =
+ new QualifiedName(PLUGIN_ID, "userOverrideDefaultSchemaName"); //$NON-NLS-1$
+
+ /**
* The identifier for the JPA validation marker
* (value <code>"org.eclipse.jpt.core.jpaProblemMarker"</code>).
*/
@@ -319,29 +319,6 @@ public class JptCorePlugin extends Plugin {
}
/**
- * Return the default schema name associated with the specified Eclipse project.
- * @see JpaProject#getUserOverrideDefaultSchemaName()
- */
- public static String getUserOverrideDefaultSchemaName(IProject project) {
- return getProjectPreferences(project).get(USER_OVERRIDE_DEFAULT_SCHEMA_NAME, null);
- }
-
- /**
- * Set the default schema name associated with the specified Eclipse project.
- * @see JpaProject#setUserOverrideDefaultSchemaName()
- */
- public static void setUserOverrideDefaultSchemaName(IProject project, String defaultSchemaName) {
- IEclipsePreferences prefs = getProjectPreferences(project);
- if (defaultSchemaName == null) {
- prefs.remove(USER_OVERRIDE_DEFAULT_SCHEMA_NAME);
- }
- else {
- prefs.put(USER_OVERRIDE_DEFAULT_SCHEMA_NAME, defaultSchemaName);
- }
- flush(prefs);
- }
-
- /**
* Return the JPA "discover" flag associated with the specified
* Eclipse project.
*/
@@ -394,6 +371,33 @@ public class JptCorePlugin extends Plugin {
log(ex);
}
}
+
+ /**
+ * Return the default schema name associated with the specified Eclipse project.
+ * @see JpaProject#getUserOverrideDefaultSchemaName()
+ */
+ public static String getUserOverrideDefaultSchemaName(IProject project) {
+ try {
+ return project.getPersistentProperty(USER_OVERRIDE_DEFAULT_SCHEMA_NAME);
+ }
+ catch (CoreException ce) {
+ log(ce);
+ return null;
+ }
+ }
+
+ /**
+ * Set the default schema name associated with the specified Eclipse project.
+ * @see JpaProject#setUserOverrideDefaultSchemaName()
+ */
+ public static void setUserOverrideDefaultSchemaName(IProject project, String defaultSchemaName) {
+ try {
+ project.setPersistentProperty(USER_OVERRIDE_DEFAULT_SCHEMA_NAME, defaultSchemaName);
+ }
+ catch (CoreException ce) {
+ log(ce);
+ }
+ }
/**
* Log the specified status.

Back to the top