diff options
author | kmoore | 2011-10-12 20:47:49 +0000 |
---|---|---|
committer | kmoore | 2011-10-12 20:47:49 +0000 |
commit | 7f49dcc945693757c1099d5166a65bafffce3e05 (patch) | |
tree | 1dfd391b08fbc3f967333011c6afd95a0f14f481 /jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal | |
parent | 79ec39e5326001df2162c61994d2fa1585c499d9 (diff) | |
download | webtools.dali-7f49dcc945693757c1099d5166a65bafffce3e05.tar.gz webtools.dali-7f49dcc945693757c1099d5166a65bafffce3e05.tar.xz webtools.dali-7f49dcc945693757c1099d5166a65bafffce3e05.zip |
360725 - [Multi-Tenancy] Invalid validation message against mapped superclass
Diffstat (limited to 'jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal')
6 files changed, 35 insertions, 18 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java index 5db6f3a26d..17c361848b 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java @@ -17,6 +17,7 @@ import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable; import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable; import org.eclipse.jpt.jpa.core.context.AttributeMapping; +import org.eclipse.jpt.jpa.core.context.InheritanceType; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType; import org.eclipse.jpt.jpa.core.internal.context.JptValidator; import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaEntity; @@ -182,6 +183,14 @@ public class JavaEclipseLinkEntityImpl return JptJpaEclipseLinkCorePlugin.nodeIsEclipseLink2_3Compatible(this); } + public boolean isMultitenantMetadataAllowed() { + return this.isRootEntity() || this.isInheritanceStrategyTablePerClass(); + } + + protected boolean isInheritanceStrategyTablePerClass() { + return this.getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS; + } + // ********** discriminator column ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java index fd16012a98..e431505dda 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java @@ -183,6 +183,9 @@ public class JavaEclipseLinkMappedSuperclassImpl return JptJpaEclipseLinkCorePlugin.nodeIsEclipseLink2_3Compatible(this); } + public boolean isMultitenantMetadataAllowed() { + return true; + } // ********** misc ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMultitenancyImpl2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMultitenancyImpl2_3.java index 5020c73714..723a2f8e9c 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMultitenancyImpl2_3.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMultitenancyImpl2_3.java @@ -563,15 +563,7 @@ public class JavaEclipseLinkMultitenancyImpl2_3 } protected boolean isMultitenantMetadataAllowed() { - return this.isRootEntity() || this.isInheritanceStrategyTablePerClass(); - } - - protected boolean isRootEntity() { - return this.getParent().isRootEntity(); - } - - protected boolean isInheritanceStrategyTablePerClass() { - return this.getParent().getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS; + return this.getParent().isMultitenantMetadataAllowed(); } protected boolean isMultitenantInheritanceHierarchy() { @@ -581,6 +573,10 @@ public class JavaEclipseLinkMultitenancyImpl2_3 return this.isRootEntityMultitenant(); } + protected boolean isInheritanceStrategyTablePerClass() { + return this.getParent().getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS; + } + protected boolean isRootEntityMultitenant() { EclipseLinkEntity rootEntity = this.getRootEntity(); return rootEntity != null && rootEntity != getParent() && rootEntity.getMultitenancy().isMultitenant(); diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java index 2d13c8d018..3109eb567d 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java @@ -21,6 +21,7 @@ import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable; import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable; import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable; import org.eclipse.jpt.jpa.core.context.AttributeMapping; +import org.eclipse.jpt.jpa.core.context.InheritanceType; import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType; import org.eclipse.jpt.jpa.core.internal.context.JptValidator; import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmEntity; @@ -189,6 +190,14 @@ public class OrmEclipseLinkEntityImpl return JptJpaEclipseLinkCorePlugin.nodeIsEclipseLink2_3Compatible(this); } + public boolean isMultitenantMetadataAllowed() { + return this.isRootEntity() || this.isInheritanceStrategyTablePerClass(); + } + + protected boolean isInheritanceStrategyTablePerClass() { + return this.getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS; + } + // ********** misc ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java index 25bc42f446..1aeed2eb1b 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java @@ -184,6 +184,10 @@ public class OrmEclipseLinkMappedSuperclassImpl return JptJpaEclipseLinkCorePlugin.nodeIsEclipseLink2_3Compatible(this); } + public boolean isMultitenantMetadataAllowed() { + return true; + } + // ********** misc ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMultitenancyImpl2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMultitenancyImpl2_3.java index dd85087ad8..c146990dfc 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMultitenancyImpl2_3.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMultitenancyImpl2_3.java @@ -610,15 +610,7 @@ public class OrmEclipseLinkMultitenancyImpl2_3 } protected boolean isMultitenantMetadataAllowed() { - return this.isRootEntity() || this.isInheritanceStrategyTablePerClass(); - } - - protected boolean isRootEntity() { - return this.getParent().isRootEntity(); - } - - protected boolean isInheritanceStrategyTablePerClass() { - return this.getParent().getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS; + return this.getParent().isMultitenantMetadataAllowed(); } protected boolean isMultitenantInheritanceHierarchy() { @@ -628,6 +620,10 @@ public class OrmEclipseLinkMultitenancyImpl2_3 return this.isRootEntityMultitenant(); } + protected boolean isInheritanceStrategyTablePerClass() { + return this.getParent().getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS; + } + protected boolean isRootEntityMultitenant() { EclipseLinkEntity rootEntity = this.getRootEntity(); return rootEntity != null && rootEntity != getParent() && rootEntity.getMultitenancy().isMultitenant(); |