409337 - Fix invalid validation message for PK join columns
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 54f929a..e2e85ff 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 @@
 	 * 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 787a7f6..c2e3236 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 @@
 
 	@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);
 		}
 	}