Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Hauge2013-05-31 21:36:26 +0000
committerNeil Hauge2013-05-31 21:36:26 +0000
commitda44823efc12ee3e1962e6adbc24afb0fcc61f28 (patch)
treee4ee007ee585bdf5f625271083fb707dc14451af
parent87f1ce663b4c9c3966f559d315b7c7c307195530 (diff)
downloadwebtools.dali-da44823efc12ee3e1962e6adbc24afb0fcc61f28.tar.gz
webtools.dali-da44823efc12ee3e1962e6adbc24afb0fcc61f28.tar.xz
webtools.dali-da44823efc12ee3e1962e6adbc24afb0fcc61f28.zip
409337 - Fix invalid validation message for PK join columnsv201305312216
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEntity.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/JavaEntityPrimaryKeyJoinColumnValidator.java8
2 files changed, 5 insertions, 5 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEntity.java
index 54f929a647..e2e85ffdcc 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEntity.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaEntity.java
@@ -1120,7 +1120,7 @@ public abstract class AbstractJavaEntity
* Return whether the entity is a descendant in (as opposed to the root of)
* an inheritance hierarchy.
*/
- protected boolean isDescendant() {
+ public boolean isDescendant() {
return ! this.isRootEntity();
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/JavaEntityPrimaryKeyJoinColumnValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/JavaEntityPrimaryKeyJoinColumnValidator.java
index 787a7f65a8..c2e3236172 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/JavaEntityPrimaryKeyJoinColumnValidator.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/JavaEntityPrimaryKeyJoinColumnValidator.java
@@ -30,10 +30,10 @@ public class JavaEntityPrimaryKeyJoinColumnValidator
@Override
protected void validateJoinColumnName(List<IMessage> messages) {
- if ( ! this.entity.isRootNoDescendantsNoStrategyDefined()) {
- messages.add(this.buildUnresolvedNameMessage(this.getVirtualPKJoinColumnUnresolvedNameMessage()));
- }
- else if (this.entity.getSpecifiedPrimaryKeyJoinColumnsSize() > 0) {
+ // Based on the spec., the PrimaryKeyJoinColumn annotation is really only meaningful when
+ // applying on an entity subclass so we only validate it when an entity is a descendant or an entity
+ // has specified primary key join columns
+ if (this.entity.isDescendant() || this.entity.getSpecifiedPrimaryKeyJoinColumnsSize() > 0) {
super.validateJoinColumnName(messages);
}
}

Back to the top