Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetya Sabeva2012-09-11 01:51:08 -0400
committerPetya Sabeva2012-09-11 01:51:08 -0400
commitff1d9b0c5eb44c6306ed711b8ac47d05336a01aa (patch)
tree6d5448bd1b974b9a3c30ce2d935e3b94a32592c4
parent9a94e7ee910177c9195bc0689019fa31c6052d15 (diff)
parentf763ba8e486f0ffef17e029ed48b5861221fa7f0 (diff)
downloadwebtools.dali-ff1d9b0c5eb44c6306ed711b8ac47d05336a01aa.tar.gz
webtools.dali-ff1d9b0c5eb44c6306ed711b8ac47d05336a01aa.tar.xz
webtools.dali-ff1d9b0c5eb44c6306ed711b8ac47d05336a01aa.zip
Merge branch 'master' of http://git.eclipse.org/gitroot/dali/webtools.dali.git
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaOverrideRelationship.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmOverrideRelationship.java13
2 files changed, 14 insertions, 9 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaOverrideRelationship.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaOverrideRelationship.java
index 65040835c4..f9deb2abef 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaOverrideRelationship.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJavaOverrideRelationship.java
@@ -15,13 +15,13 @@ import org.eclipse.jpt.jpa.core.context.Entity;
import org.eclipse.jpt.jpa.core.context.MappedByRelationship;
import org.eclipse.jpt.jpa.core.context.OverrideRelationship;
import org.eclipse.jpt.jpa.core.context.ReadOnlyBaseColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyTableColumn.Owner;
import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumnRelationship;
import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinTable;
import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinTableRelationship;
import org.eclipse.jpt.jpa.core.context.ReadOnlyOverrideRelationship;
import org.eclipse.jpt.jpa.core.context.ReadOnlyRelationship;
+import org.eclipse.jpt.jpa.core.context.ReadOnlyTableColumn.Owner;
import org.eclipse.jpt.jpa.core.context.Relationship;
import org.eclipse.jpt.jpa.core.context.RelationshipMapping;
import org.eclipse.jpt.jpa.core.context.RelationshipStrategy;
@@ -285,7 +285,7 @@ public class GenericJavaOverrideRelationship
return result;
}
- return this.strategy.getCompletionProposals(pos);
+ return (this.strategy == null) ? null : this.strategy.getCompletionProposals(pos);
}
@@ -298,7 +298,11 @@ public class GenericJavaOverrideRelationship
@Override
public void validate(List<IMessage> messages, IReporter reporter) {
super.validate(messages, reporter);
- this.strategy.validate(messages, reporter);
+ // prevent NPE on JPA 2_0 platforms
+ // this.strategy == null when the mapping relationship strategy, e.g. mappedBy, cannot be overridden
+ if (this.strategy != null) {
+ this.strategy.validate(messages, reporter);
+ }
}
public JptValidator buildJoinTableValidator(ReadOnlyJoinTable table) {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmOverrideRelationship.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmOverrideRelationship.java
index c893406576..4087478b47 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmOverrideRelationship.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmOverrideRelationship.java
@@ -288,7 +288,11 @@ public class GenericOrmOverrideRelationship
@Override
public void validate(List<IMessage> messages, IReporter reporter) {
super.validate(messages, reporter);
- this.strategy.validate(messages, reporter);
+ // prevent NPE on JPA 2_0 platforms
+ // this.strategy == null when the mapping relationship strategy, e.g. mapped-by, cannot be overridden
+ if (this.strategy != null) {
+ this.strategy.validate(messages, reporter);
+ }
}
public JptValidator buildJoinTableValidator(ReadOnlyJoinTable table) {
@@ -311,10 +315,7 @@ public class GenericOrmOverrideRelationship
if (result != null) {
return result;
}
- result = this.strategy.getCompletionProposals(pos);
- if (result != null) {
- return result;
- }
- return null;
+
+ return this.strategy == null ? null : this.strategy.getCompletionProposals(pos);
}
}

Back to the top