Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2010-09-02 13:07:58 -0400
committerkmoore2010-09-02 13:07:58 -0400
commitfb2b0808b94e85bebf70df2f8e1e497aceb63000 (patch)
tree68f7d335e00b004ccd1452d7f18762af324dbf54
parentc5f896981a6a64da3fd2a750ebe8ac8bff24e34e (diff)
downloadwebtools.dali-fb2b0808b94e85bebf70df2f8e1e497aceb63000.tar.gz
webtools.dali-fb2b0808b94e85bebf70df2f8e1e497aceb63000.tar.xz
webtools.dali-fb2b0808b94e85bebf70df2f8e1e497aceb63000.zip
fixed validation when table is defined in java single-table inheritance hierarchy, entity overriden in orm.xml
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmEntity.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmEntity.java
index 3b1d822901..45e77c61da 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmEntity.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmEntity.java
@@ -1048,7 +1048,11 @@ public abstract class AbstractOrmEntity
protected boolean isAbstractTablePerClass() {
return isAbstract() && isTablePerClass();
}
-
+
+ protected boolean isResourceTableSpecified() {
+ return this.table.isResourceSpecified() || (getJavaEntity() != null && getJavaEntity().getTable().isResourceSpecified());
+ }
+
/**
* Return whether the entity is a part of a "table per class"
* inheritance hierarchy.
@@ -1662,7 +1666,7 @@ public abstract class AbstractOrmEntity
protected void validateTable(List<IMessage> messages, IReporter reporter) {
if (isAbstractTablePerClass()) {
- if (this.table.isResourceSpecified()) {
+ if (this.isResourceTableSpecified()) {
messages.add(
DefaultJpaValidationMessages.buildMessage(
IMessage.HIGH_SEVERITY,
@@ -1676,7 +1680,7 @@ public abstract class AbstractOrmEntity
return;
}
if (isSingleTableDescendant()) {
- if (this.table.isResourceSpecified()) {
+ if (this.isResourceTableSpecified()) {
messages.add(
DefaultJpaValidationMessages.buildMessage(
IMessage.HIGH_SEVERITY,

Back to the top