Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbvosburgh2010-01-22 05:36:28 +0000
committerbvosburgh2010-01-22 05:36:28 +0000
commitf5f0a3dd14e9817d4bc076fd326dfb6ccc17868b (patch)
treea349e5a48120d12803bf5ab7869589920fe2e6f3
parent6e4e87ff4f1df4c9cd8112f49f171803098abeed (diff)
downloadwebtools.dali-f5f0a3dd14e9817d4bc076fd326dfb6ccc17868b.tar.gz
webtools.dali-f5f0a3dd14e9817d4bc076fd326dfb6ccc17868b.tar.xz
webtools.dali-f5f0a3dd14e9817d4bc076fd326dfb6ccc17868b.zip
[299695] problem opening JPA project with active database connection
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaDatabaseIdentifierAdapter.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaDatabaseIdentifierAdapter.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaDatabaseIdentifierAdapter.java
index 6d77b1f723..22886cdf1a 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaDatabaseIdentifierAdapter.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/GenericJpaDatabaseIdentifierAdapter.java
@@ -12,6 +12,7 @@ package org.eclipse.jpt.core.internal.jpa2;
import java.util.Iterator;
import org.eclipse.jpt.core.JpaDataSource;
+import org.eclipse.jpt.core.context.JpaRootContextNode;
import org.eclipse.jpt.core.context.persistence.Persistence;
import org.eclipse.jpt.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.core.context.persistence.PersistenceXml;
@@ -68,7 +69,12 @@ public class GenericJpaDatabaseIdentifierAdapter
}
protected PersistenceXml getPersistenceXml() {
- return this.dataSource.getJpaProject().getRootContextNode().getPersistenceXml();
+ // TODO this null check can be removed if the data source is moved to the persistence unit;
+ // the root context node can be null during construction;
+ // this shouldn't be a problem since the default-delimiters flag
+ // is recalculated during the initial, post-project construction, "update"
+ JpaRootContextNode rcn = this.dataSource.getJpaProject().getRootContextNode();
+ return (rcn == null) ? null : rcn.getPersistenceXml();
}
}

Back to the top