Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkmoore2010-09-16 13:04:01 -0400
committerkmoore2010-09-16 13:04:01 -0400
commita2fce568bbc4537ecb750aeebc3312caca10b108 (patch)
tree65b7d5634adcd6c72a4588b098568cafc15b083f
parent465cb2e2249b284bc5c64ea3c31a906e872a2e92 (diff)
downloadwebtools.dali-a2fce568bbc4537ecb750aeebc3312caca10b108.tar.gz
webtools.dali-a2fce568bbc4537ecb750aeebc3312caca10b108.tar.xz
webtools.dali-a2fce568bbc4537ecb750aeebc3312caca10b108.zip
190321 - attribute/association override name validation
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties9
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation_description.properties3
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseOverride.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OverrideContainer.java3
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOverride.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverride.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverride.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOverride.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlContextNodeFactory.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/OverrideTextRangeResolver.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaEntity.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOverride.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOverrideTextRangeResolver.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmEntity.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNodeFactory.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOverrideTextRangeResolver.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/AbstractOverrideValidator.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/AssociationOverrideValidator.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/AttributeOverrideValidator.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/EmbeddableOverrideDescriptionProvider.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/MapKeyAttributeOverrideValidator.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/MappedSuperclassOverrideDescriptionProvider.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverrideContainer.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAttributeOverrideContainer.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddedMapping.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/AbstractOrmOverride.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverride.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverrideContainer.java13
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverride.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverrideContainer.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedMapping.java7
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/AbstractJavaElementCollectionMapping2_0.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java17
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationDescriptionMessages.java5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverride.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverride.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOverride.java2
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_validation_preferences.properties8
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiValidationPreferenceMessages.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/preferences/JpaProblemSeveritiesPage.java8
45 files changed, 807 insertions, 39 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties b/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties
index b98ce79549..d831132da3 100644
--- a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties
+++ b/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation.properties
@@ -206,7 +206,14 @@ VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=In implied a
MAP_KEY_COLUMN_TABLE_NOT_VALID=Table \"{0}\" for map key column \"{1}\" {2}
VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_TABLE_NOT_VALID=In implied attribute \"{0}\", table \"{1}\" for map key column \"{2}\" {3}
-
+ATTRIBUTE_OVERRIDE_INVALID_NAME=Attribute override \"{0}\" cannot be resolved to an attribute {1} \"{2}\"
+VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_INVALID_NAME=In implied attribute \"{0}\", attribute override \"{1}\" cannot be resolved to an attribute {2} \"{3}\"
+ASSOCIATION_OVERRIDE_INVALID_NAME=Association override \"{0}\" cannot be resolved to an attribute {1} \"{2}\"
+VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVALID_NAME=In implied attribute \"{0}\", association override \"{1}\" cannot be resolved to an attribute {2} \"{3}\"
+VIRTUAL_ATTRIBUTE_OVERRIDE_INVALID_NAME=Implied attribute override \"{0}\" cannot be resolved to an attribute {1} \"{2}\"
+VIRTUAL_ASSOCIATION_OVERRIDE_INVALID_NAME=Implied association override \"{0}\" cannot be resolved to an attribute {1} \"{2}\"
+VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME=Implied map key attribute override \"{0}\" cannot be resolved to an attribute {1} \"{2}\"
+VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME=In implied attribute \"{0}\", map key attribute override \"{1}\" cannot be resolved to an attribute {2} \"{3}\"
diff --git a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation_description.properties b/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation_description.properties
index 4d59ad01a3..c5922c7c23 100644
--- a/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation_description.properties
+++ b/jpa/plugins/org.eclipse.jpt.core/property_files/jpa_validation_description.properties
@@ -18,3 +18,6 @@ NOT_VALID_FOR_THIS_ENTITY=is not valid for this entity
ATTRIBUTE_DESC=attribute ''{0}''
VIRTUAL_ATTRIBUTE_DESC=implied attribute ''{0}''
+
+ON_MAPPED_SUPERCLASS=on the mapped superclass
+ON_EMBEDDABLE=on the embeddable
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseOverride.java
index d6264bd428..e3cecb5a21 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseOverride.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/BaseOverride.java
@@ -12,6 +12,7 @@ package org.eclipse.jpt.core.context;
import java.util.Iterator;
import org.eclipse.jpt.core.internal.context.BaseColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JptValidator;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
import org.eclipse.jpt.db.Table;
/**
@@ -55,7 +56,16 @@ public interface BaseOverride
* @return
*/
TypeMapping getTypeMapping();
-
+
+ /**
+ * Return the type mapping that contains the attributes/associations to be overridden.
+ * (Though the type mapping may not *directly* own them. i.e. they may be on a supertype
+ * mapping.)
+ * (For example, on an entity, this would be the supertype mapping of that entity. On
+ * an embedded, this would be the target type mapping of the embedded.)
+ */
+ TypeMapping getOverridableTypeMapping();
+
/**
* Return an Iterator of all attribute names that can be overridden
*/
@@ -98,5 +108,7 @@ public interface BaseOverride
String getDefaultTableName();
JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner owner, BaseColumnTextRangeResolver textRangeResolver);
+
+ JptValidator buildValidator(BaseOverride override, OverrideTextRangeResolver textRangeResolver);
}
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OverrideContainer.java
index 4b92020982..cafa805f28 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OverrideContainer.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/OverrideContainer.java
@@ -12,6 +12,7 @@ package org.eclipse.jpt.core.context;
import java.util.Iterator;
import org.eclipse.jpt.core.internal.context.BaseColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JptValidator;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
/**
* Provisional API: This interface is part of an interim API that is still
@@ -73,6 +74,8 @@ public interface OverrideContainer
*/
Iterator<String> candidateTableNames();
+ JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver);
+
JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner columnOwner, BaseColumnTextRangeResolver textRangeResolver);
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOverride.java
index 0b27af86cd..9205f7e8b5 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOverride.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/java/JavaOverride.java
@@ -9,8 +9,10 @@
******************************************************************************/
package org.eclipse.jpt.core.context.java;
+import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.context.BaseOverride;
import org.eclipse.jpt.core.resource.java.OverrideAnnotation;
+import org.eclipse.jpt.core.utility.TextRange;
/**
*
@@ -21,7 +23,7 @@ import org.eclipse.jpt.core.resource.java.OverrideAnnotation;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 2.3
+ * @version 3.0
* @since 2.3
*/
public interface JavaOverride
@@ -30,6 +32,11 @@ public interface JavaOverride
OverrideAnnotation getOverrideAnnotation();
+ /**
+ * Return the (best guess) text location of the override's name.
+ */
+ TextRange getNameTextRange(CompilationUnit astRoot);
+
interface Owner extends BaseOverride.Owner
{
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverride.java
index c882aebc5e..b4b62e3578 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverride.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAssociationOverride.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.core.context.orm;
import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.XmlContextNode;
import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
/**
@@ -22,11 +21,11 @@ import org.eclipse.jpt.core.resource.orm.XmlAssociationOverride;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 2.3
+ * @version 3.0
* @since 2.0
*/
public interface OrmAssociationOverride
- extends AssociationOverride, XmlContextNode
+ extends AssociationOverride, OrmOverride
{
OrmAssociationOverrideRelationshipReference getRelationshipReference();
@@ -37,4 +36,11 @@ public interface OrmAssociationOverride
* resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
*/
void update(XmlAssociationOverride associationOverride);
+
+ OrmAssociationOverride.Owner getOwner();
+
+ interface Owner extends AssociationOverride.Owner, OrmOverride.Owner
+ {
+ //nothing yet
+ }
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverride.java
index d048c8c965..dbe0ca572a 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverride.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmAttributeOverride.java
@@ -10,7 +10,6 @@
package org.eclipse.jpt.core.context.orm;
import org.eclipse.jpt.core.context.AttributeOverride;
-import org.eclipse.jpt.core.context.XmlContextNode;
import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
/**
@@ -20,11 +19,11 @@ import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
* pioneering adopters on the understanding that any code that uses this API
* will almost certainly be broken (repeatedly) as the API evolves.
*
- * @version 2.3
+ * @version 3.0
* @since 2.0
*/
public interface OrmAttributeOverride
- extends AttributeOverride, XmlContextNode
+ extends AttributeOverride, OrmOverride
{
OrmColumn getColumn();
@@ -35,4 +34,10 @@ public interface OrmAttributeOverride
* resource model object. see {@link org.eclipse.jpt.core.JpaProject#update()}
*/
void update(XmlAttributeOverride attributeOverride);
+
+ interface Owner
+ extends AttributeOverride.Owner, OrmOverride.Owner
+ {
+ //nothing yet
+ }
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOverride.java
new file mode 100644
index 0000000000..20aba5f545
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmOverride.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.core.context.orm;
+
+import org.eclipse.jpt.core.context.BaseOverride;
+import org.eclipse.jpt.core.context.XmlContextNode;
+import org.eclipse.jpt.core.utility.TextRange;
+
+/**
+ *
+ *
+ * Provisional API: This interface is part of an interim API that is still
+ * under development and expected to change significantly before reaching
+ * stability. It is available at this early stage to solicit feedback from
+ * pioneering adopters on the understanding that any code that uses this API
+ * will almost certainly be broken (repeatedly) as the API evolves.
+ *
+ * @version 3.0
+ * @since 3.0
+ */
+public interface OrmOverride
+ extends BaseOverride, XmlContextNode
+{
+
+ /**
+ * Return the (best guess) text location of the override's name.
+ */
+ TextRange getNameTextRange();
+
+ interface Owner extends BaseOverride.Owner
+ {
+ //nothing yet
+ }
+} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlContextNodeFactory.java
index 123974aa20..cbdfab8d10 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlContextNodeFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/context/orm/OrmXmlContextNodeFactory.java
@@ -9,8 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.core.context.orm;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeOverride;
import org.eclipse.jpt.core.context.JoiningStrategy;
import org.eclipse.jpt.core.context.Orderable;
import org.eclipse.jpt.core.context.Table;
@@ -105,9 +103,9 @@ public interface OrmXmlContextNodeFactory
OrmAssociationOverrideContainer buildOrmAssociationOverrideContainer(XmlContextNode parent, OrmAssociationOverrideContainer.Owner owner);
- OrmAttributeOverride buildOrmAttributeOverride(OrmAttributeOverrideContainer parent, AttributeOverride.Owner owner, XmlAttributeOverride xmlAttributeOverride);
+ OrmAttributeOverride buildOrmAttributeOverride(OrmAttributeOverrideContainer parent, OrmAttributeOverride.Owner owner, XmlAttributeOverride xmlAttributeOverride);
- OrmAssociationOverride buildOrmAssociationOverride(OrmAssociationOverrideContainer parent, AssociationOverride.Owner owner, XmlAssociationOverride associationOverride);
+ OrmAssociationOverride buildOrmAssociationOverride(OrmAssociationOverrideContainer parent, OrmAssociationOverride.Owner owner, XmlAssociationOverride associationOverride);
OrmAssociationOverrideRelationshipReference buildOrmAssociationOverrideRelationshipReference(OrmAssociationOverride parent, XmlAssociationOverride associationOverride);
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/OverrideTextRangeResolver.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/OverrideTextRangeResolver.java
new file mode 100644
index 0000000000..281cfb8791
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/OverrideTextRangeResolver.java
@@ -0,0 +1,21 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle.
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.core.internal.context;
+
+import org.eclipse.jpt.core.utility.TextRange;
+
+/**
+ * Interface to resolve text ranges on named columns
+ */
+public interface OverrideTextRangeResolver
+{
+ TextRange getNameTextRange();
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java
index 9aaf1d6a49..28217ee14f 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java
@@ -26,7 +26,10 @@ import org.eclipse.jpt.core.context.java.JavaPersistentAttribute;
import org.eclipse.jpt.core.internal.context.BaseColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JptValidator;
import org.eclipse.jpt.core.internal.context.MappingTools;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
import org.eclipse.jpt.core.internal.jpa1.context.AttributeOverrideColumnValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.AttributeOverrideValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.EmbeddableOverrideDescriptionProvider;
import org.eclipse.jpt.core.internal.jpa1.context.EntityTableDescriptionProvider;
import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
@@ -289,6 +292,10 @@ public abstract class AbstractJavaBaseEmbeddedMapping<T extends Annotation>
public TextRange getValidationTextRange(CompilationUnit astRoot) {
return AbstractJavaBaseEmbeddedMapping.this.getValidationTextRange(astRoot);
}
+
+ public JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver) {
+ return new AttributeOverrideValidator((AttributeOverride) override, (AttributeOverride.Owner) owner, textRangeResolver, new EmbeddableOverrideDescriptionProvider());
+ }
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner owner, BaseColumnTextRangeResolver textRangeResolver) {
return new AttributeOverrideColumnValidator((AttributeOverride) override, column, textRangeResolver, new EntityTableDescriptionProvider());
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaEntity.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaEntity.java
index ab6a533e96..e5cdff300d 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaEntity.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaEntity.java
@@ -29,6 +29,7 @@ import org.eclipse.jpt.core.context.DiscriminatorType;
import org.eclipse.jpt.core.context.Entity;
import org.eclipse.jpt.core.context.InheritanceType;
import org.eclipse.jpt.core.context.JoinColumn;
+import org.eclipse.jpt.core.context.JoinColumn.Owner;
import org.eclipse.jpt.core.context.JoinTable;
import org.eclipse.jpt.core.context.NamedColumn;
import org.eclipse.jpt.core.context.PersistentAttribute;
@@ -38,7 +39,6 @@ import org.eclipse.jpt.core.context.RelationshipReference;
import org.eclipse.jpt.core.context.SecondaryTable;
import org.eclipse.jpt.core.context.Table;
import org.eclipse.jpt.core.context.TypeMapping;
-import org.eclipse.jpt.core.context.JoinColumn.Owner;
import org.eclipse.jpt.core.context.java.JavaAssociationOverrideContainer;
import org.eclipse.jpt.core.context.java.JavaAttributeOverrideContainer;
import org.eclipse.jpt.core.context.java.JavaBaseJoinColumn;
@@ -58,16 +58,20 @@ import org.eclipse.jpt.core.internal.context.JoinColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JptValidator;
import org.eclipse.jpt.core.internal.context.MappingTools;
import org.eclipse.jpt.core.internal.context.NamedColumnTextRangeResolver;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
import org.eclipse.jpt.core.internal.context.TableTextRangeResolver;
import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideInverseJoinColumnValidator;
import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideJoinColumnValidator;
import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideJoinTableValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideValidator;
import org.eclipse.jpt.core.internal.jpa1.context.AttributeOverrideColumnValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.AttributeOverrideValidator;
import org.eclipse.jpt.core.internal.jpa1.context.DiscriminatorColumnValidator;
import org.eclipse.jpt.core.internal.jpa1.context.EntityPrimaryKeyJoinColumnValidator;
import org.eclipse.jpt.core.internal.jpa1.context.EntityTableDescriptionProvider;
import org.eclipse.jpt.core.internal.jpa1.context.GenericEntityPrimaryKeyValidator;
import org.eclipse.jpt.core.internal.jpa1.context.JoinTableTableDescriptionProvider;
+import org.eclipse.jpt.core.internal.jpa1.context.MappedSuperclassOverrideDescriptionProvider;
import org.eclipse.jpt.core.internal.jpa1.context.SecondaryTableValidator;
import org.eclipse.jpt.core.internal.jpa1.context.TableValidator;
import org.eclipse.jpt.core.internal.resource.java.NullPrimaryKeyJoinColumnAnnotation;
@@ -1597,6 +1601,10 @@ public abstract class AbstractJavaEntity
return AbstractJavaEntity.this.getValidationTextRange(astRoot);
}
+ public JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver) {
+ return new AssociationOverrideValidator((AssociationOverride) override, (AssociationOverride.Owner) owner, textRangeResolver, new MappedSuperclassOverrideDescriptionProvider());
+ }
+
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner owner, BaseColumnTextRangeResolver textRangeResolver) {
return new AssociationOverrideJoinColumnValidator((AssociationOverride) override, (JoinColumn) column, (JoinColumn.Owner) owner, (JoinColumnTextRangeResolver) textRangeResolver, new EntityTableDescriptionProvider());
}
@@ -1709,6 +1717,10 @@ public abstract class AbstractJavaEntity
public TextRange getValidationTextRange(CompilationUnit astRoot) {
return AbstractJavaEntity.this.getValidationTextRange(astRoot);
}
+
+ public JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver) {
+ return new AttributeOverrideValidator((AttributeOverride) override, (AttributeOverride.Owner) owner, textRangeResolver, new MappedSuperclassOverrideDescriptionProvider());
+ }
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner owner, BaseColumnTextRangeResolver textRangeResolver) {
return new AttributeOverrideColumnValidator((AttributeOverride) override, column, textRangeResolver, new EntityTableDescriptionProvider());
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java
index 3902147207..f2d5428ab7 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java
@@ -37,8 +37,11 @@ import org.eclipse.jpt.core.internal.context.BaseColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JptValidator;
import org.eclipse.jpt.core.internal.context.MappingTools;
import org.eclipse.jpt.core.internal.context.NamedColumnTextRangeResolver;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
+import org.eclipse.jpt.core.internal.jpa1.context.EmbeddableOverrideDescriptionProvider;
import org.eclipse.jpt.core.internal.jpa1.context.JoiningStrategyTableDescriptionProvider;
import org.eclipse.jpt.core.internal.jpa1.context.MapKeyAttributeOverrideColumnValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.MapKeyAttributeOverrideValidator;
import org.eclipse.jpt.core.internal.jpa1.context.MapKeyColumnValidator;
import org.eclipse.jpt.core.internal.jpa2.context.java.NullJavaMapKeyColumn2_0;
import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
@@ -799,6 +802,10 @@ public abstract class AbstractJavaMultiRelationshipMapping<T extends Relationshi
public Column resolveOverriddenColumn(String attributeOverrideName) {
return MappingTools.resolveOverridenColumn(getOverridableTypeMapping(), attributeOverrideName);
}
+
+ public JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver) {
+ return new MapKeyAttributeOverrideValidator((AttributeOverride) override, (AttributeOverride.Owner) owner, textRangeResolver, new EmbeddableOverrideDescriptionProvider());
+ }
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner owner, BaseColumnTextRangeResolver textRangeResolver) {
return new MapKeyAttributeOverrideColumnValidator((AttributeOverride) override, column, textRangeResolver, new JoiningStrategyTableDescriptionProvider(getPredominantJoiningStrategy()));
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOverride.java
index edc6319823..bbbac99f19 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOverride.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/AbstractJavaOverride.java
@@ -10,15 +10,20 @@
package org.eclipse.jpt.core.internal.context.java;
import java.util.Iterator;
+import java.util.List;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jpt.core.context.BaseOverride;
import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
import org.eclipse.jpt.core.context.java.JavaOverride;
+import org.eclipse.jpt.core.internal.context.JptValidator;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
import org.eclipse.jpt.core.resource.java.OverrideAnnotation;
import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.jpt.utility.Filter;
import org.eclipse.jpt.utility.internal.StringTools;
import org.eclipse.jpt.utility.internal.iterators.FilteringIterator;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
public abstract class AbstractJavaOverride
@@ -143,11 +148,32 @@ public abstract class AbstractJavaOverride
TextRange textRange = this.overrideAnnotation.getTextRange(astRoot);
return (textRange != null) ? textRange : this.getParent().getValidationTextRange(astRoot);
}
-
+
+ public TextRange getNameTextRange(CompilationUnit astRoot) {
+ TextRange textRange = this.overrideAnnotation.getNameTextRange(astRoot);
+ return (textRange != null) ? textRange : this.getValidationTextRange(astRoot);
+ }
+
@Override
public void toString(StringBuilder sb) {
super.toString(sb);
sb.append(getName());
}
+
+ // ********** validation **********
+
+ @Override
+ public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
+ super.validate(messages, reporter, astRoot);
+ this.buildValidator(astRoot).validate(messages, reporter);
+ }
+
+ protected JptValidator buildValidator(CompilationUnit astRoot) {
+ return this.getOwner().buildValidator(this, buildTextRangeResolver(astRoot));
+ }
+
+ protected OverrideTextRangeResolver buildTextRangeResolver(CompilationUnit astRoot) {
+ return new JavaOverrideTextRangeResolver(this, astRoot);
+ }
} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOverrideTextRangeResolver.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOverrideTextRangeResolver.java
new file mode 100644
index 0000000000..598b53d31d
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/java/JavaOverrideTextRangeResolver.java
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle.
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.core.internal.context.java;
+
+import org.eclipse.jdt.core.dom.CompilationUnit;
+import org.eclipse.jpt.core.context.java.JavaOverride;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
+import org.eclipse.jpt.core.utility.TextRange;
+
+public class JavaOverrideTextRangeResolver
+ implements OverrideTextRangeResolver
+{
+ protected final JavaOverride javaOverride;
+
+ protected final CompilationUnit astRoot;
+
+ public JavaOverrideTextRangeResolver(JavaOverride javaOverride, CompilationUnit astRoot) {
+ this.javaOverride = javaOverride;
+ this.astRoot = astRoot;
+ }
+
+ protected JavaOverride getOverride() {
+ return this.javaOverride;
+ }
+
+ public TextRange getNameTextRange() {
+ return this.javaOverride.getNameTextRange(this.astRoot);
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java
index 7ad004ba19..fba6e55f02 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java
@@ -29,10 +29,12 @@ import org.eclipse.jpt.core.context.orm.OrmTypeMapping;
import org.eclipse.jpt.core.internal.context.BaseColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JptValidator;
import org.eclipse.jpt.core.internal.context.MappingTools;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
import org.eclipse.jpt.core.internal.jpa1.context.AttributeOverrideColumnValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.AttributeOverrideValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.EmbeddableOverrideDescriptionProvider;
import org.eclipse.jpt.core.internal.jpa1.context.EntityTableDescriptionProvider;
import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
import org.eclipse.jpt.core.resource.orm.AbstractXmlEmbedded;
import org.eclipse.jpt.core.resource.orm.XmlAttributeOverride;
@@ -288,6 +290,10 @@ public abstract class AbstractOrmBaseEmbeddedMapping<T extends AbstractXmlEmbedd
public String getDefaultTableName() {
return getTypeMapping().getPrimaryTableName();
}
+
+ public JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver) {
+ return new AttributeOverrideValidator(getPersistentAttribute(), (AttributeOverride) override, (AttributeOverride.Owner) owner, textRangeResolver, new EmbeddableOverrideDescriptionProvider());
+ }
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner owner, BaseColumnTextRangeResolver textRangeResolver) {
return new AttributeOverrideColumnValidator(getPersistentAttribute(), (AttributeOverride) override, column, textRangeResolver, new EntityTableDescriptionProvider());
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 48b90bd992..98a8d85d2a 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
@@ -70,17 +70,21 @@ import org.eclipse.jpt.core.internal.context.JoinColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JptValidator;
import org.eclipse.jpt.core.internal.context.MappingTools;
import org.eclipse.jpt.core.internal.context.NamedColumnTextRangeResolver;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
import org.eclipse.jpt.core.internal.context.TableTextRangeResolver;
import org.eclipse.jpt.core.internal.context.java.AbstractJavaEntity;
import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideInverseJoinColumnValidator;
import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideJoinColumnValidator;
import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideJoinTableValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideValidator;
import org.eclipse.jpt.core.internal.jpa1.context.AttributeOverrideColumnValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.AttributeOverrideValidator;
import org.eclipse.jpt.core.internal.jpa1.context.DiscriminatorColumnValidator;
import org.eclipse.jpt.core.internal.jpa1.context.EntityPrimaryKeyJoinColumnValidator;
import org.eclipse.jpt.core.internal.jpa1.context.EntityTableDescriptionProvider;
import org.eclipse.jpt.core.internal.jpa1.context.GenericEntityPrimaryKeyValidator;
import org.eclipse.jpt.core.internal.jpa1.context.JoinTableTableDescriptionProvider;
+import org.eclipse.jpt.core.internal.jpa1.context.MappedSuperclassOverrideDescriptionProvider;
import org.eclipse.jpt.core.internal.jpa1.context.SecondaryTableValidator;
import org.eclipse.jpt.core.internal.jpa1.context.TableValidator;
import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
@@ -1873,6 +1877,10 @@ public abstract class AbstractOrmEntity
public String getDefaultTableName() {
return AbstractOrmEntity.this.getPrimaryTableName();
}
+
+ public JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver) {
+ return new AssociationOverrideValidator((AssociationOverride) override, (AssociationOverride.Owner) owner, textRangeResolver, new MappedSuperclassOverrideDescriptionProvider());
+ }
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner owner, BaseColumnTextRangeResolver textRangeResolver) {
return new AssociationOverrideJoinColumnValidator((AssociationOverride) override, (JoinColumn) column, (JoinColumn.Owner) owner, (JoinColumnTextRangeResolver) textRangeResolver, new EntityTableDescriptionProvider());
@@ -2002,6 +2010,10 @@ public abstract class AbstractOrmEntity
public String getDefaultTableName() {
return AbstractOrmEntity.this.getPrimaryTableName();
}
+
+ public JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver) {
+ return new AttributeOverrideValidator((AttributeOverride) override, (AttributeOverride.Owner) owner, textRangeResolver, new MappedSuperclassOverrideDescriptionProvider());
+ }
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner owner, BaseColumnTextRangeResolver textRangeResolver) {
return new AttributeOverrideColumnValidator((AttributeOverride) override, column, textRangeResolver, new EntityTableDescriptionProvider());
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java
index 07c9743f8c..95bccc457b 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java
@@ -40,8 +40,11 @@ import org.eclipse.jpt.core.internal.context.BaseColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JptValidator;
import org.eclipse.jpt.core.internal.context.MappingTools;
import org.eclipse.jpt.core.internal.context.NamedColumnTextRangeResolver;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
+import org.eclipse.jpt.core.internal.jpa1.context.EmbeddableOverrideDescriptionProvider;
import org.eclipse.jpt.core.internal.jpa1.context.JoiningStrategyTableDescriptionProvider;
import org.eclipse.jpt.core.internal.jpa1.context.MapKeyAttributeOverrideColumnValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.MapKeyAttributeOverrideValidator;
import org.eclipse.jpt.core.internal.jpa1.context.MapKeyColumnValidator;
import org.eclipse.jpt.core.jpa2.context.Orderable2_0;
import org.eclipse.jpt.core.jpa2.context.java.JavaCollectionMapping2_0;
@@ -801,6 +804,10 @@ public abstract class AbstractOrmMultiRelationshipMapping<T extends AbstractXmlM
public boolean tableNameIsInvalid(String tableName) {
return !StringTools.stringsAreEqual(getDefaultTableName(), tableName);
}
+
+ public JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver) {
+ return new MapKeyAttributeOverrideValidator(getPersistentAttribute(), (AttributeOverride) override, (AttributeOverride.Owner) owner, textRangeResolver, new EmbeddableOverrideDescriptionProvider());
+ }
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner owner, BaseColumnTextRangeResolver textRangeResolver) {
return new MapKeyAttributeOverrideColumnValidator(getPersistentAttribute(), (AttributeOverride) override, column, textRangeResolver, new JoiningStrategyTableDescriptionProvider(getPredominantJoiningStrategy()));
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNodeFactory.java
index 8f60cb8b0d..b0eb724e47 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNodeFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/AbstractOrmXmlContextNodeFactory.java
@@ -9,8 +9,6 @@
******************************************************************************/
package org.eclipse.jpt.core.internal.context.orm;
-import org.eclipse.jpt.core.context.AssociationOverride;
-import org.eclipse.jpt.core.context.AttributeOverride;
import org.eclipse.jpt.core.context.JoiningStrategy;
import org.eclipse.jpt.core.context.Orderable;
import org.eclipse.jpt.core.context.Table;
@@ -243,11 +241,11 @@ public abstract class AbstractOrmXmlContextNodeFactory
return new NullOrmAssociationOverrideContainer(parent, owner);
}
- public OrmAttributeOverride buildOrmAttributeOverride(OrmAttributeOverrideContainer parent, AttributeOverride.Owner owner, XmlAttributeOverride xmlAttributeOverride) {
+ public OrmAttributeOverride buildOrmAttributeOverride(OrmAttributeOverrideContainer parent, OrmAttributeOverride.Owner owner, XmlAttributeOverride xmlAttributeOverride) {
return new GenericOrmAttributeOverride(parent, owner, xmlAttributeOverride);
}
- public OrmAssociationOverride buildOrmAssociationOverride(OrmAssociationOverrideContainer parent, AssociationOverride.Owner owner, XmlAssociationOverride xmlAssociationOverride) {
+ public OrmAssociationOverride buildOrmAssociationOverride(OrmAssociationOverrideContainer parent, OrmAssociationOverride.Owner owner, XmlAssociationOverride xmlAssociationOverride) {
return new GenericOrmAssociationOverride(parent, owner, xmlAssociationOverride);
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOverrideTextRangeResolver.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOverrideTextRangeResolver.java
new file mode 100644
index 0000000000..f8f9f400bd
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/context/orm/OrmOverrideTextRangeResolver.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle.
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.core.internal.context.orm;
+
+import org.eclipse.jpt.core.context.orm.OrmOverride;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
+import org.eclipse.jpt.core.utility.TextRange;
+
+public class OrmOverrideTextRangeResolver
+ implements OverrideTextRangeResolver
+{
+ protected final OrmOverride ormOverride;
+
+ public OrmOverrideTextRangeResolver(OrmOverride ormOverride) {
+ this.ormOverride = ormOverride;
+ }
+
+ protected OrmOverride getOverride() {
+ return this.ormOverride;
+ }
+
+ public TextRange getNameTextRange() {
+ return this.ormOverride.getNameTextRange();
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/AbstractOverrideValidator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/AbstractOverrideValidator.java
new file mode 100644
index 0000000000..5865a35b00
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/AbstractOverrideValidator.java
@@ -0,0 +1,154 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle.
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.core.internal.jpa1.context;
+
+import java.util.List;
+import org.eclipse.jpt.core.context.BaseOverride;
+import org.eclipse.jpt.core.context.PersistentAttribute;
+import org.eclipse.jpt.core.internal.context.JptValidator;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
+import org.eclipse.jpt.core.internal.validation.DefaultJpaValidationMessages;
+import org.eclipse.jpt.utility.internal.CollectionTools;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
+
+public abstract class AbstractOverrideValidator
+ implements JptValidator
+{
+
+ protected final PersistentAttribute persistentAttribute;
+
+ protected final BaseOverride override;
+
+ protected final BaseOverride.Owner owner;
+
+ protected final OverrideTextRangeResolver textRangeResolver;
+
+ protected final OverrideDescriptionProvider overrideDescriptionProvider;
+
+ protected AbstractOverrideValidator(
+ BaseOverride override,
+ BaseOverride.Owner owner,
+ OverrideTextRangeResolver textRangeResolver,
+ OverrideDescriptionProvider overrideDescriptionProvider) {
+ this(null, override, owner, textRangeResolver, overrideDescriptionProvider);
+ }
+
+
+ protected AbstractOverrideValidator(
+ PersistentAttribute persistentAttribute,
+ BaseOverride override,
+ BaseOverride.Owner owner,
+ OverrideTextRangeResolver textRangeResolver,
+ OverrideDescriptionProvider overrideDescriptionProvider) {
+ this.persistentAttribute = persistentAttribute;
+ this.override = override;
+ this.owner = owner;
+ this.textRangeResolver = textRangeResolver;
+ this.overrideDescriptionProvider = overrideDescriptionProvider;
+ }
+
+ protected BaseOverride getOverride() {
+ return this.override;
+ }
+
+ protected BaseOverride.Owner getOwner() {
+ return this.owner;
+ }
+
+ protected OverrideTextRangeResolver getTextRangeResolver() {
+ return this.textRangeResolver;
+ }
+
+ protected boolean isPersistentAttributeVirtual() {
+ return this.persistentAttribute != null && this.persistentAttribute.isVirtual();
+ }
+
+ protected String getPersistentAttributeName() {
+ return this.persistentAttribute.getName();
+ }
+
+ protected String getOverrideDescriptionMessage() {
+ return this.overrideDescriptionProvider.getOverrideDescriptionMessage();
+ }
+
+ public boolean validate(List<IMessage> messages, IReporter reporter) {
+ return this.validateName(messages);
+ }
+
+ protected boolean validateName(List<IMessage> messages) {
+ if (!CollectionTools.contains(this.getOwner().allOverridableAttributeNames(), this.getOverride().getName())) {
+ messages.add(this.buildUnresolvedNameMessage());
+ return false;
+ }
+ return true;
+ }
+
+ protected IMessage buildUnresolvedNameMessage() {
+ if (this.override.isVirtual()) {
+ return this.buildVirtualUnresolvedNameMessage();
+ }
+ if (isPersistentAttributeVirtual()) {
+ return this.buildVirtualAttributeUnresolvedNameMessage();
+ }
+ return this.buildUnresolvedNameMessage(this.getUnresolvedNameMessage());
+ }
+
+ protected IMessage buildVirtualUnresolvedNameMessage() {
+ return DefaultJpaValidationMessages.buildMessage(
+ IMessage.HIGH_SEVERITY,
+ getVirtualOverrideUnresolvedNameMessage(),
+ new String[] {
+ this.getOverride().getName(),
+ this.getOverrideDescriptionMessage(),
+ this.getOwner().getOverridableTypeMapping().getName()},
+ this.getOverride(),
+ this.textRangeResolver.getNameTextRange()
+ );
+ }
+
+ protected abstract String getVirtualOverrideUnresolvedNameMessage();
+
+ protected IMessage buildUnresolvedNameMessage(String message) {
+ return DefaultJpaValidationMessages.buildMessage(
+ IMessage.HIGH_SEVERITY,
+ message,
+ new String[] {
+ this.getOverride().getName(),
+ this.getOverrideDescriptionMessage(),
+ this.getOwner().getOverridableTypeMapping().getName()},
+ this.getOverride(),
+ this.textRangeResolver.getNameTextRange());
+ }
+
+ protected abstract String getUnresolvedNameMessage();
+
+ protected IMessage buildVirtualAttributeUnresolvedNameMessage() {
+ return DefaultJpaValidationMessages.buildMessage(
+ IMessage.HIGH_SEVERITY,
+ getVirtualAttributeUnresolvedNameMessage(),
+ new String[] {
+ this.getPersistentAttributeName(),
+ this.getOverride().getName(),
+ this.getOverrideDescriptionMessage(),
+ this.getOwner().getOverridableTypeMapping().getName()},
+ this.getOverride(),
+ this.textRangeResolver.getNameTextRange());
+ }
+
+ protected abstract String getVirtualAttributeUnresolvedNameMessage();
+
+
+ public static interface OverrideDescriptionProvider {
+ String getOverrideDescriptionMessage();
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/AssociationOverrideValidator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/AssociationOverrideValidator.java
new file mode 100644
index 0000000000..754deebabf
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/AssociationOverrideValidator.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle.
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.core.internal.jpa1.context;
+
+import org.eclipse.jpt.core.context.AssociationOverride;
+import org.eclipse.jpt.core.context.PersistentAttribute;
+import org.eclipse.jpt.core.internal.context.JptValidator;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
+import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
+
+public class AssociationOverrideValidator
+ extends AbstractOverrideValidator
+ implements JptValidator
+{
+
+ public AssociationOverrideValidator(
+ AssociationOverride override,
+ AssociationOverride.Owner owner,
+ OverrideTextRangeResolver textRangeResolver,
+ OverrideDescriptionProvider overrideDescriptionProvider) {
+ super(override, owner, textRangeResolver, overrideDescriptionProvider);
+ }
+
+ public AssociationOverrideValidator(
+ PersistentAttribute persistentAttribute,
+ AssociationOverride override,
+ AssociationOverride.Owner owner,
+ OverrideTextRangeResolver textRangeResolver,
+ OverrideDescriptionProvider overrideDescriptionProvider) {
+ super(persistentAttribute, override, owner, textRangeResolver, overrideDescriptionProvider);
+ }
+
+ @Override
+ protected String getVirtualOverrideUnresolvedNameMessage() {
+ return JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_INVALID_NAME;
+ }
+
+ @Override
+ protected String getUnresolvedNameMessage() {
+ return JpaValidationMessages.ASSOCIATION_OVERRIDE_INVALID_NAME;
+ }
+
+ @Override
+ protected String getVirtualAttributeUnresolvedNameMessage() {
+ return JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVALID_NAME;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/AttributeOverrideValidator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/AttributeOverrideValidator.java
new file mode 100644
index 0000000000..c2a9603b4f
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/AttributeOverrideValidator.java
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle.
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.core.internal.jpa1.context;
+
+import org.eclipse.jpt.core.context.AttributeOverride;
+import org.eclipse.jpt.core.context.PersistentAttribute;
+import org.eclipse.jpt.core.internal.context.JptValidator;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
+import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
+
+public class AttributeOverrideValidator
+ extends AbstractOverrideValidator
+ implements JptValidator
+{
+
+ public AttributeOverrideValidator(
+ AttributeOverride override,
+ AttributeOverride.Owner owner,
+ OverrideTextRangeResolver textRangeResolver,
+ OverrideDescriptionProvider overrideDescriptionProvider) {
+ super(override, owner, textRangeResolver, overrideDescriptionProvider);
+ }
+
+ public AttributeOverrideValidator(
+ PersistentAttribute persistentAttribute,
+ AttributeOverride override,
+ AttributeOverride.Owner owner,
+ OverrideTextRangeResolver textRangeResolver,
+ OverrideDescriptionProvider overrideDescriptionProvider) {
+ super(persistentAttribute, override, owner, textRangeResolver, overrideDescriptionProvider);
+ }
+
+ @Override
+ protected String getVirtualOverrideUnresolvedNameMessage() {
+ return JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_INVALID_NAME;
+ }
+
+ @Override
+ protected String getUnresolvedNameMessage() {
+ return JpaValidationMessages.ATTRIBUTE_OVERRIDE_INVALID_NAME;
+ }
+
+ @Override
+ protected String getVirtualAttributeUnresolvedNameMessage() {
+ return JpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_INVALID_NAME;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/EmbeddableOverrideDescriptionProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/EmbeddableOverrideDescriptionProvider.java
new file mode 100644
index 0000000000..64daca7df4
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/EmbeddableOverrideDescriptionProvider.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle.
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.core.internal.jpa1.context;
+
+import org.eclipse.jpt.core.internal.jpa1.context.AbstractOverrideValidator.OverrideDescriptionProvider;
+import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
+
+public class EmbeddableOverrideDescriptionProvider implements OverrideDescriptionProvider
+{
+ public String getOverrideDescriptionMessage() {
+ return JpaValidationDescriptionMessages.ON_EMBEDDABLE;
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/MapKeyAttributeOverrideValidator.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/MapKeyAttributeOverrideValidator.java
new file mode 100644
index 0000000000..3324aeb1b0
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/MapKeyAttributeOverrideValidator.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle.
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.core.internal.jpa1.context;
+
+import org.eclipse.jpt.core.context.AttributeOverride;
+import org.eclipse.jpt.core.context.PersistentAttribute;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
+import org.eclipse.jpt.core.internal.validation.JpaValidationMessages;
+
+public class MapKeyAttributeOverrideValidator
+ extends AttributeOverrideValidator
+{
+
+ public MapKeyAttributeOverrideValidator(
+ AttributeOverride override,
+ AttributeOverride.Owner owner,
+ OverrideTextRangeResolver textRangeResolver,
+ OverrideDescriptionProvider overrideDescriptionProvider) {
+ super(override, owner, textRangeResolver, overrideDescriptionProvider);
+ }
+
+ public MapKeyAttributeOverrideValidator(
+ PersistentAttribute persistentAttribute,
+ AttributeOverride override,
+ AttributeOverride.Owner owner,
+ OverrideTextRangeResolver textRangeResolver,
+ OverrideDescriptionProvider overrideDescriptionProvider) {
+ super(persistentAttribute, override, owner, textRangeResolver, overrideDescriptionProvider);
+ }
+
+ @Override
+ protected String getVirtualOverrideUnresolvedNameMessage() {
+ return JpaValidationMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME;
+ }
+
+ @Override
+ protected String getVirtualAttributeUnresolvedNameMessage() {
+ return JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME;
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/MappedSuperclassOverrideDescriptionProvider.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/MappedSuperclassOverrideDescriptionProvider.java
new file mode 100644
index 0000000000..aa9a9958d9
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/MappedSuperclassOverrideDescriptionProvider.java
@@ -0,0 +1,22 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Oracle.
+ * All rights reserved. This program and the accompanying materials are
+ * made available under the terms of the Eclipse Public License v1.0 which
+ * accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jpt.core.internal.jpa1.context;
+
+import org.eclipse.jpt.core.internal.jpa1.context.AbstractOverrideValidator.OverrideDescriptionProvider;
+import org.eclipse.jpt.core.internal.validation.JpaValidationDescriptionMessages;
+
+public class MappedSuperclassOverrideDescriptionProvider implements OverrideDescriptionProvider
+{
+ public String getOverrideDescriptionMessage() {
+ return JpaValidationDescriptionMessages.ON_MAPPED_SUPERCLASS;
+ }
+
+}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverrideContainer.java
index c3054d7e43..5079c6cc81 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverrideContainer.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAssociationOverrideContainer.java
@@ -30,6 +30,7 @@ import org.eclipse.jpt.core.internal.context.BaseColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JoinColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JptValidator;
import org.eclipse.jpt.core.internal.context.MappingTools;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
import org.eclipse.jpt.core.internal.context.TableTextRangeResolver;
import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
import org.eclipse.jpt.core.resource.java.AssociationOverrideAnnotation;
@@ -401,6 +402,10 @@ public class GenericJavaAssociationOverrideContainer extends AbstractJavaJpaCont
return getOwner().getTypeMapping();
}
+ public TypeMapping getOverridableTypeMapping() {
+ return getOwner().getOverridableTypeMapping();
+ }
+
public Iterator<String> allOverridableAttributeNames() {
return GenericJavaAssociationOverrideContainer.this.allOverridableAssociationNames();
}
@@ -425,6 +430,10 @@ public class GenericJavaAssociationOverrideContainer extends AbstractJavaJpaCont
return getOwner().getDbTable(tableName);
}
+ public JptValidator buildValidator(BaseOverride override, OverrideTextRangeResolver textRangeResolver) {
+ return getOwner().buildValidator(override, this, textRangeResolver);
+ }
+
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner owner, BaseColumnTextRangeResolver textRangeResolver) {
return getOwner().buildColumnValidator(override, column, owner, textRangeResolver);
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAttributeOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAttributeOverrideContainer.java
index 1a90ce0781..a026588c18 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAttributeOverrideContainer.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaAttributeOverrideContainer.java
@@ -24,6 +24,7 @@ import org.eclipse.jpt.core.context.java.JavaAttributeOverrideContainer;
import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
import org.eclipse.jpt.core.internal.context.BaseColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JptValidator;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
import org.eclipse.jpt.core.internal.context.java.AbstractJavaJpaContextNode;
import org.eclipse.jpt.core.internal.context.java.VirtualAttributeOverrideAnnotation;
import org.eclipse.jpt.core.resource.java.Annotation;
@@ -417,6 +418,10 @@ public class GenericJavaAttributeOverrideContainer extends AbstractJavaJpaContex
return getOwner().getTypeMapping();
}
+ public TypeMapping getOverridableTypeMapping() {
+ return getOwner().getOverridableTypeMapping();
+ }
+
public Iterator<String> allOverridableAttributeNames() {
return GenericJavaAttributeOverrideContainer.this.allOverridableAttributeNames();
}
@@ -441,6 +446,10 @@ public class GenericJavaAttributeOverrideContainer extends AbstractJavaJpaContex
return getOwner().getDbTable(tableName);
}
+ public JptValidator buildValidator(BaseOverride override, OverrideTextRangeResolver textRangeResolver) {
+ return getOwner().buildValidator(override, this, textRangeResolver);
+ }
+
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner owner, BaseColumnTextRangeResolver textRangeResolver) {
return getOwner().buildColumnValidator(override, column, owner, textRangeResolver);
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddedMapping.java
index 4f40cffbfe..1d2a6eda06 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddedMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/java/GenericJavaEmbeddedMapping.java
@@ -30,11 +30,14 @@ import org.eclipse.jpt.core.internal.context.BaseColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JoinColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JptValidator;
import org.eclipse.jpt.core.internal.context.MappingTools;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
import org.eclipse.jpt.core.internal.context.TableTextRangeResolver;
import org.eclipse.jpt.core.internal.context.java.AbstractJavaBaseEmbeddedMapping;
import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideInverseJoinColumnValidator;
import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideJoinColumnValidator;
import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideJoinTableValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.EmbeddableOverrideDescriptionProvider;
import org.eclipse.jpt.core.internal.jpa1.context.EntityTableDescriptionProvider;
import org.eclipse.jpt.core.internal.jpa1.context.JoinTableTableDescriptionProvider;
import org.eclipse.jpt.core.jpa2.JpaFactory2_0;
@@ -257,6 +260,10 @@ public class GenericJavaEmbeddedMapping
public TextRange getValidationTextRange(CompilationUnit astRoot) {
return GenericJavaEmbeddedMapping.this.getValidationTextRange(astRoot);
}
+
+ public JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver) {
+ return new AssociationOverrideValidator((AssociationOverride) override, (AssociationOverride.Owner) owner, textRangeResolver, new EmbeddableOverrideDescriptionProvider());
+ }
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner owner, BaseColumnTextRangeResolver textRangeResolver) {
return new AssociationOverrideJoinColumnValidator((AssociationOverride) override, (JoinColumn) column, (JoinColumn.Owner) owner, (JoinColumnTextRangeResolver) textRangeResolver, new EntityTableDescriptionProvider());
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/AbstractOrmOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/AbstractOrmOverride.java
index b735003d5e..688e9cffe4 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/AbstractOrmOverride.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/AbstractOrmOverride.java
@@ -9,23 +9,31 @@
******************************************************************************/
package org.eclipse.jpt.core.internal.jpa1.context.orm;
+import java.util.List;
import org.eclipse.jpt.core.context.BaseOverride;
import org.eclipse.jpt.core.context.XmlContextNode;
+import org.eclipse.jpt.core.context.orm.OrmOverride;
+import org.eclipse.jpt.core.internal.context.JptValidator;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
+import org.eclipse.jpt.core.internal.context.orm.OrmOverrideTextRangeResolver;
import org.eclipse.jpt.core.resource.orm.XmlOverride;
import org.eclipse.jpt.core.utility.TextRange;
+import org.eclipse.wst.validation.internal.provisional.core.IMessage;
+import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-public class AbstractOrmOverride extends AbstractOrmXmlContextNode
+public abstract class AbstractOrmOverride extends AbstractOrmXmlContextNode
+ implements OrmOverride
{
protected String name;
- protected final BaseOverride.Owner owner;
+ protected final Owner owner;
protected XmlOverride resourceOverride;
- public AbstractOrmOverride(XmlContextNode parent, BaseOverride.Owner owner, XmlOverride resourceOverride) {
+ protected AbstractOrmOverride(XmlContextNode parent, Owner owner, XmlOverride resourceOverride) {
super(parent);
this.owner = owner;
this.resourceOverride = resourceOverride;
@@ -37,7 +45,7 @@ public class AbstractOrmOverride extends AbstractOrmXmlContextNode
return (XmlContextNode) super.getParent();
}
- public BaseOverride.Owner getOwner() {
+ public Owner getOwner() {
return this.owner;
}
@@ -73,12 +81,32 @@ public class AbstractOrmOverride extends AbstractOrmXmlContextNode
protected String getResourceName() {
return this.resourceOverride.getName();
}
+ // ********** validation **********
+
+ @Override
+ public void validate(List<IMessage> messages, IReporter reporter) {
+ super.validate(messages, reporter);
+ this.buildValidator().validate(messages, reporter);
+ }
+
+ protected JptValidator buildValidator() {
+ return this.getOwner().buildValidator(this, buildTextRangeResolver());
+ }
+
+ protected OverrideTextRangeResolver buildTextRangeResolver() {
+ return new OrmOverrideTextRangeResolver(this);
+ }
public TextRange getValidationTextRange() {
TextRange textRange = this.resourceOverride.getValidationTextRange();
return textRange == null ? getParent().getValidationTextRange() : textRange;
}
+ public TextRange getNameTextRange() {
+ TextRange textRange = this.resourceOverride.getNameTextRange();
+ return (textRange != null) ? textRange : this.getValidationTextRange();
+ }
+
//****************** miscellaneous ********************
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverride.java
index df01a97628..95ff473640 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverride.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverride.java
@@ -24,7 +24,7 @@ public class GenericOrmAssociationOverride extends AbstractOrmOverride
protected final OrmAssociationOverrideRelationshipReference relationshipReference;
- public GenericOrmAssociationOverride(OrmAssociationOverrideContainer parent, AssociationOverride.Owner owner, XmlAssociationOverride xmlAssociationOverride) {
+ public GenericOrmAssociationOverride(OrmAssociationOverrideContainer parent, OrmAssociationOverride.Owner owner, XmlAssociationOverride xmlAssociationOverride) {
super(parent, owner, xmlAssociationOverride);
this.relationshipReference = this.buildRelationshipReference();
}
@@ -35,8 +35,8 @@ public class GenericOrmAssociationOverride extends AbstractOrmOverride
}
@Override
- public Owner getOwner() {
- return (Owner) super.getOwner();
+ public OrmAssociationOverride.Owner getOwner() {
+ return (OrmAssociationOverride.Owner) super.getOwner();
}
protected OrmAssociationOverrideRelationshipReference buildRelationshipReference() {
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverrideContainer.java
index 2f6de99b53..c2357491a7 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverrideContainer.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAssociationOverrideContainer.java
@@ -30,6 +30,7 @@ import org.eclipse.jpt.core.internal.context.BaseColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JoinColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JptValidator;
import org.eclipse.jpt.core.internal.context.MappingTools;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
import org.eclipse.jpt.core.internal.context.TableTextRangeResolver;
import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
import org.eclipse.jpt.core.resource.orm.OrmFactory;
@@ -302,7 +303,7 @@ public class GenericOrmAssociationOverrideContainer extends AbstractOrmXmlContex
return OrmFactory.eINSTANCE.createXmlAssociationOverride();
}
- protected AssociationOverride.Owner buildAssociationOverrideOwner() {
+ protected OrmAssociationOverride.Owner buildAssociationOverrideOwner() {
return new AssociationOverrideOwner();
}
@@ -322,7 +323,7 @@ public class GenericOrmAssociationOverrideContainer extends AbstractOrmXmlContex
}
- protected class AssociationOverrideOwner implements AssociationOverride.Owner {
+ protected class AssociationOverrideOwner implements OrmAssociationOverride.Owner {
public RelationshipMapping getRelationshipMapping(String attributeName) {
return MappingTools.getRelationshipMapping(attributeName, getOwner().getOverridableTypeMapping());
@@ -340,6 +341,10 @@ public class GenericOrmAssociationOverrideContainer extends AbstractOrmXmlContex
return getOwner().getTypeMapping();
}
+ public TypeMapping getOverridableTypeMapping() {
+ return getOwner().getOverridableTypeMapping();
+ }
+
public Iterator<String> allOverridableAttributeNames() {
return GenericOrmAssociationOverrideContainer.this.allOverridableAssociationNames();
}
@@ -360,6 +365,10 @@ public class GenericOrmAssociationOverrideContainer extends AbstractOrmXmlContex
return getOwner().getDbTable(tableName);
}
+ public JptValidator buildValidator(BaseOverride override, OverrideTextRangeResolver textRangeResolver) {
+ return getOwner().buildValidator(override, this, textRangeResolver);
+ }
+
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner owner, BaseColumnTextRangeResolver textRangeResolver) {
return getOwner().buildColumnValidator(override, column, owner, textRangeResolver);
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverride.java
index de4dee8db6..4467fd0c12 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverride.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverride.java
@@ -13,7 +13,6 @@ import java.util.Iterator;
import java.util.List;
import org.eclipse.jpt.core.MappingKeys;
import org.eclipse.jpt.core.context.AttributeMapping;
-import org.eclipse.jpt.core.context.AttributeOverride;
import org.eclipse.jpt.core.context.BaseColumn;
import org.eclipse.jpt.core.context.Column;
import org.eclipse.jpt.core.context.NamedColumn;
@@ -50,7 +49,7 @@ public class GenericOrmAttributeOverride
public GenericOrmAttributeOverride(
OrmAttributeOverrideContainer parent,
- AttributeOverride.Owner owner,
+ OrmAttributeOverride.Owner owner,
XmlAttributeOverride resourceAttributeOverride) {
super(parent, owner, resourceAttributeOverride);
@@ -67,9 +66,10 @@ public class GenericOrmAttributeOverride
return (OrmAttributeOverride) getOwner().setVirtual(virtual, this);
}
+
@Override
- public Owner getOwner() {
- return (Owner) super.getOwner();
+ public OrmAttributeOverride.Owner getOwner() {
+ return (OrmAttributeOverride.Owner) super.getOwner();
}
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverrideContainer.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverrideContainer.java
index 6f455e027e..1e20c50b02 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverrideContainer.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmAttributeOverrideContainer.java
@@ -14,7 +14,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.core.context.AttributeOverride;
import org.eclipse.jpt.core.context.BaseColumn;
import org.eclipse.jpt.core.context.BaseOverride;
import org.eclipse.jpt.core.context.Column;
@@ -24,6 +23,7 @@ import org.eclipse.jpt.core.context.orm.OrmAttributeOverride;
import org.eclipse.jpt.core.context.orm.OrmAttributeOverrideContainer;
import org.eclipse.jpt.core.internal.context.BaseColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JptValidator;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
import org.eclipse.jpt.core.internal.context.orm.AbstractOrmXmlContextNode;
import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeOverride;
import org.eclipse.jpt.core.resource.orm.OrmFactory;
@@ -311,7 +311,7 @@ public class GenericOrmAttributeOverrideContainer
return getXmlContextNodeFactory().buildOrmAttributeOverride(this, createAttributeOverrideOwner(), attributeOverride);
}
- protected AttributeOverride.Owner createAttributeOverrideOwner() {
+ protected OrmAttributeOverride.Owner createAttributeOverrideOwner() {
return new AttributeOverrideOwner();
}
@@ -332,7 +332,7 @@ public class GenericOrmAttributeOverrideContainer
}
- protected class AttributeOverrideOwner implements AttributeOverride.Owner {
+ protected class AttributeOverrideOwner implements OrmAttributeOverride.Owner {
public Column resolveOverriddenColumn(String attributeName) {
if (attributeName == null) {
@@ -353,6 +353,10 @@ public class GenericOrmAttributeOverrideContainer
return getOwner().getTypeMapping();
}
+ public TypeMapping getOverridableTypeMapping() {
+ return getOwner().getOverridableTypeMapping();
+ }
+
public Iterator<String> allOverridableAttributeNames() {
return GenericOrmAttributeOverrideContainer.this.allOverridableAttributeNames();
}
@@ -373,6 +377,10 @@ public class GenericOrmAttributeOverrideContainer
return getOwner().getDbTable(tableName);
}
+ public JptValidator buildValidator(BaseOverride override, OverrideTextRangeResolver textRangeResolver) {
+ return getOwner().buildValidator(override, this, textRangeResolver);
+ }
+
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner owner, BaseColumnTextRangeResolver textRangeResolver) {
return getOwner().buildColumnValidator(override, column, owner, textRangeResolver);
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedMapping.java
index 05072fea96..1aa0ce9542 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedMapping.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa1/context/orm/GenericOrmEmbeddedMapping.java
@@ -33,11 +33,14 @@ import org.eclipse.jpt.core.internal.context.BaseColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JoinColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JptValidator;
import org.eclipse.jpt.core.internal.context.MappingTools;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
import org.eclipse.jpt.core.internal.context.TableTextRangeResolver;
import org.eclipse.jpt.core.internal.context.orm.AbstractOrmBaseEmbeddedMapping;
import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideInverseJoinColumnValidator;
import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideJoinColumnValidator;
import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideJoinTableValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.EmbeddableOverrideDescriptionProvider;
import org.eclipse.jpt.core.internal.jpa1.context.EntityTableDescriptionProvider;
import org.eclipse.jpt.core.internal.jpa1.context.JoinTableTableDescriptionProvider;
import org.eclipse.jpt.core.jpa2.context.java.JavaEmbeddedMapping2_0;
@@ -278,6 +281,10 @@ public class GenericOrmEmbeddedMapping
public TextRange getValidationTextRange() {
return GenericOrmEmbeddedMapping.this.getValidationTextRange();
}
+
+ public JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver) {
+ return new AssociationOverrideValidator(getPersistentAttribute(), (AssociationOverride) override, (AssociationOverride.Owner) owner, textRangeResolver, new EmbeddableOverrideDescriptionProvider());
+ }
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner owner, BaseColumnTextRangeResolver textRangeResolver) {
return new AssociationOverrideJoinColumnValidator(getPersistentAttribute(), (AssociationOverride) override, (JoinColumn) column, (JoinColumn.Owner) owner, (JoinColumnTextRangeResolver) textRangeResolver, new EntityTableDescriptionProvider());
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/AbstractJavaElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/AbstractJavaElementCollectionMapping2_0.java
index 7728045b93..3b0a9ebffd 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/AbstractJavaElementCollectionMapping2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/java/AbstractJavaElementCollectionMapping2_0.java
@@ -45,12 +45,17 @@ import org.eclipse.jpt.core.internal.context.JoinColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JptValidator;
import org.eclipse.jpt.core.internal.context.MappingTools;
import org.eclipse.jpt.core.internal.context.NamedColumnTextRangeResolver;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
import org.eclipse.jpt.core.internal.context.TableTextRangeResolver;
import org.eclipse.jpt.core.internal.context.java.AbstractJavaAttributeMapping;
import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideJoinColumnValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideValidator;
import org.eclipse.jpt.core.internal.jpa1.context.AttributeOverrideColumnValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.AttributeOverrideValidator;
import org.eclipse.jpt.core.internal.jpa1.context.CollectionTableTableDescriptionProvider;
+import org.eclipse.jpt.core.internal.jpa1.context.EmbeddableOverrideDescriptionProvider;
import org.eclipse.jpt.core.internal.jpa1.context.MapKeyAttributeOverrideColumnValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.MapKeyAttributeOverrideValidator;
import org.eclipse.jpt.core.internal.jpa1.context.MapKeyColumnValidator;
import org.eclipse.jpt.core.internal.jpa1.context.NamedColumnValidator;
import org.eclipse.jpt.core.internal.jpa2.context.CollectionTableValidator;
@@ -1354,6 +1359,10 @@ public abstract class AbstractJavaElementCollectionMapping2_0
return !overrideName.startsWith("key."); //$NON-NLS-1$
}
+ public JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver) {
+ return new AssociationOverrideValidator((AssociationOverride) override, (AssociationOverride.Owner) owner, textRangeResolver, new EmbeddableOverrideDescriptionProvider());
+ }
+
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner columnOwner, BaseColumnTextRangeResolver textRangeResolver) {
return new AssociationOverrideJoinColumnValidator((AssociationOverride) override, (JoinColumn) column, (JoinColumn.Owner) columnOwner, (JoinColumnTextRangeResolver) textRangeResolver, new CollectionTableTableDescriptionProvider());
}
@@ -1409,6 +1418,10 @@ public abstract class AbstractJavaElementCollectionMapping2_0
}
return !overrideName.startsWith("key."); //$NON-NLS-1$
}
+
+ public JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver) {
+ return new AttributeOverrideValidator((AttributeOverride) override, (AttributeOverride.Owner) owner, textRangeResolver, new EmbeddableOverrideDescriptionProvider());
+ }
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner columnOwner, BaseColumnTextRangeResolver textRangeResolver) {
return new AttributeOverrideColumnValidator((AttributeOverride) override, column, textRangeResolver, new CollectionTableTableDescriptionProvider());
@@ -1450,6 +1463,10 @@ public abstract class AbstractJavaElementCollectionMapping2_0
public Column resolveOverriddenColumn(String attributeOverrideName) {
return MappingTools.resolveOverridenColumn(getOverridableTypeMapping(), attributeOverrideName);
}
+
+ public JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver) {
+ return new MapKeyAttributeOverrideValidator((AttributeOverride) override, (AttributeOverride.Owner) owner, textRangeResolver, new EmbeddableOverrideDescriptionProvider());
+ }
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner columnOwner, BaseColumnTextRangeResolver textRangeResolver) {
return new MapKeyAttributeOverrideColumnValidator((AttributeOverride) override, column, textRangeResolver, new CollectionTableTableDescriptionProvider());
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java
index eea9553231..960fad85b8 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java
@@ -49,13 +49,18 @@ import org.eclipse.jpt.core.internal.context.JoinColumnTextRangeResolver;
import org.eclipse.jpt.core.internal.context.JptValidator;
import org.eclipse.jpt.core.internal.context.MappingTools;
import org.eclipse.jpt.core.internal.context.NamedColumnTextRangeResolver;
+import org.eclipse.jpt.core.internal.context.OverrideTextRangeResolver;
import org.eclipse.jpt.core.internal.context.TableTextRangeResolver;
import org.eclipse.jpt.core.internal.context.orm.AbstractOrmAttributeMapping;
import org.eclipse.jpt.core.internal.context.orm.VirtualXmlAttributeOverrideColumn;
import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideJoinColumnValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.AssociationOverrideValidator;
import org.eclipse.jpt.core.internal.jpa1.context.AttributeOverrideColumnValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.AttributeOverrideValidator;
import org.eclipse.jpt.core.internal.jpa1.context.CollectionTableTableDescriptionProvider;
+import org.eclipse.jpt.core.internal.jpa1.context.EmbeddableOverrideDescriptionProvider;
import org.eclipse.jpt.core.internal.jpa1.context.MapKeyAttributeOverrideColumnValidator;
+import org.eclipse.jpt.core.internal.jpa1.context.MapKeyAttributeOverrideValidator;
import org.eclipse.jpt.core.internal.jpa1.context.MapKeyColumnValidator;
import org.eclipse.jpt.core.internal.jpa1.context.NamedColumnValidator;
import org.eclipse.jpt.core.internal.jpa2.context.CollectionTableValidator;
@@ -1446,6 +1451,10 @@ public abstract class AbstractOrmElementCollectionMapping2_0<T extends XmlElemen
throw new UnsupportedOperationException("An element collection containing a nested relationship mapping using a JoinTable is not supported"); //$NON-NLS-1$
}
+ public JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver) {
+ return new AssociationOverrideValidator(getPersistentAttribute(), (AssociationOverride) override, (AssociationOverride.Owner) owner, textRangeResolver, new EmbeddableOverrideDescriptionProvider());
+ }
+
public JptValidator buildJoinTableInverseJoinColumnValidator(AssociationOverride override, JoinColumn column, Owner owner, JoinColumnTextRangeResolver textRangeResolver) {
throw new UnsupportedOperationException("An element collection containing a nested relationship mapping using a JoinTable is not supported"); //$NON-NLS-1$
}
@@ -1494,6 +1503,10 @@ public abstract class AbstractOrmElementCollectionMapping2_0<T extends XmlElemen
public XmlColumn buildVirtualXmlColumn(Column overridableColumn, String attributeName, boolean isMetadataComplete) {
return new VirtualXmlAttributeOverrideColumn(overridableColumn);
}
+
+ public JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver) {
+ return new AttributeOverrideValidator(getPersistentAttribute(), (AttributeOverride) override, (AttributeOverride.Owner) owner, textRangeResolver, new EmbeddableOverrideDescriptionProvider());
+ }
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner columnOwner, BaseColumnTextRangeResolver textRangeResolver) {
return new AttributeOverrideColumnValidator(getPersistentAttribute(), (AttributeOverride) override, column, textRangeResolver, new CollectionTableTableDescriptionProvider());
@@ -1538,6 +1551,10 @@ public abstract class AbstractOrmElementCollectionMapping2_0<T extends XmlElemen
return new VirtualXmlAttributeOverrideColumn(overridableColumn);
}
+ public JptValidator buildValidator(BaseOverride override, BaseOverride.Owner owner, OverrideTextRangeResolver textRangeResolver) {
+ return new MapKeyAttributeOverrideValidator(getPersistentAttribute(), (AttributeOverride) override, (AttributeOverride.Owner) owner, textRangeResolver, new EmbeddableOverrideDescriptionProvider());
+ }
+
public JptValidator buildColumnValidator(BaseOverride override, BaseColumn column, BaseColumn.Owner columnOwner, BaseColumnTextRangeResolver textRangeResolver) {
return new MapKeyAttributeOverrideColumnValidator(getPersistentAttribute(), (AttributeOverride) override, column, textRangeResolver, new CollectionTableTableDescriptionProvider());
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationDescriptionMessages.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationDescriptionMessages.java
index b93e76f6ec..df807f50ca 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationDescriptionMessages.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationDescriptionMessages.java
@@ -20,7 +20,10 @@ public class JpaValidationDescriptionMessages {
public static String ATTRIBUTE_DESC;
public static String VIRTUAL_ATTRIBUTE_DESC;
-
+ public static String ON_MAPPED_SUPERCLASS;
+ public static String ON_EMBEDDABLE;
+
+
private static final String BUNDLE_NAME = "jpa_validation_description"; //$NON-NLS-1$
private static final Class<?> BUNDLE_CLASS = JpaValidationDescriptionMessages.class;
static {
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java
index 485350155c..b8bb90459a 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/internal/validation/JpaValidationMessages.java
@@ -86,6 +86,14 @@ public interface JpaValidationMessages {
public static final String ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_COLUMN_SPECIFIED = "ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_COLUMN_SPECIFIED";
public static final String EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED = "EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED";
public static final String ATTRIBUTE_OVERRIDE_MAPPED_BY_RELATIONSHIP_AND_SPECIFIED = "ATTRIBUTE_OVERRIDE_MAPPED_BY_RELATIONSHIP_AND_SPECIFIED";
+ public static final String ATTRIBUTE_OVERRIDE_INVALID_NAME = "ATTRIBUTE_OVERRIDE_INVALID_NAME";
+ public static final String VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_INVALID_NAME = "VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_INVALID_NAME";
+ public static final String ASSOCIATION_OVERRIDE_INVALID_NAME = "ASSOCIATION_OVERRIDE_INVALID_NAME";
+ public static final String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVALID_NAME = "VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVALID_NAME";
+ public static final String VIRTUAL_ATTRIBUTE_OVERRIDE_INVALID_NAME = "VIRTUAL_ATTRIBUTE_OVERRIDE_INVALID_NAME";
+ public static final String VIRTUAL_ASSOCIATION_OVERRIDE_INVALID_NAME = "VIRTUAL_ASSOCIATION_OVERRIDE_INVALID_NAME";
+ public static final String VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME = "VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME";
+ public static final String VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME = "VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME";
public static final String TABLE_UNRESOLVED_CATALOG = "TABLE_UNRESOLVED_CATALOG";
public static final String TABLE_UNRESOLVED_SCHEMA = "TABLE_UNRESOLVED_SCHEMA";
public static final String TABLE_UNRESOLVED_NAME = "TABLE_UNRESOLVED_NAME";
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverride.java
index c5a0332d93..83dfa15d45 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverride.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAssociationOverride.java
@@ -23,6 +23,7 @@ import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
import org.eclipse.jpt.core.resource.orm.v2_0.XmlAssociationOverride_2_0;
import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
+import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.wst.common.internal.emf.resource.Translator;
/**
@@ -467,7 +468,13 @@ public class XmlAssociationOverride extends AbstractJpaEObject implements XmlOve
result.append(')');
return result.toString();
}
-
+
+
+ public TextRange getNameTextRange() {
+ return getAttributeTextRange(JPA.NAME);
+ }
+
+
// ********** translators **********
public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
@@ -498,4 +505,6 @@ public class XmlAssociationOverride extends AbstractJpaEObject implements XmlOve
protected static Translator buildJoinTableTranslator() {
return XmlJoinTable.buildTranslator(JPA.JOIN_TABLE, OrmV2_0Package.eINSTANCE.getXmlAssociationOverride_2_0_JoinTable());
}
+
+
}
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverride.java
index 28593c09dd..294fcc0b2e 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverride.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlAttributeOverride.java
@@ -19,6 +19,7 @@ import org.eclipse.jpt.core.internal.utility.translators.SimpleTranslator;
import org.eclipse.jpt.core.resource.orm.v2_0.OrmV2_0Package;
import org.eclipse.jpt.core.resource.orm.v2_0.XmlAttributeOverride_2_0;
import org.eclipse.jpt.core.resource.xml.AbstractJpaEObject;
+import org.eclipse.jpt.core.utility.TextRange;
import org.eclipse.wst.common.internal.emf.resource.Translator;
/**
@@ -404,7 +405,13 @@ public class XmlAttributeOverride extends AbstractJpaEObject implements XmlOverr
result.append(')');
return result.toString();
}
-
+
+
+ public TextRange getNameTextRange() {
+ return getAttributeTextRange(JPA.NAME);
+ }
+
+
// ********** translators **********
public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
diff --git a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOverride.java b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOverride.java
index ec3c36fc2f..77c9e0998e 100644
--- a/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOverride.java
+++ b/jpa/plugins/org.eclipse.jpt.core/src/org/eclipse/jpt/core/resource/orm/XmlOverride.java
@@ -10,6 +10,7 @@
package org.eclipse.jpt.core.resource.orm;
import org.eclipse.jpt.core.resource.xml.JpaEObject;
+import org.eclipse.jpt.core.utility.TextRange;
/**
* <!-- begin-user-doc -->
@@ -62,4 +63,5 @@ public interface XmlOverride extends JpaEObject
*/
void setName(String value);
+ TextRange getNameTextRange();
} // XmlOverride
diff --git a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_validation_preferences.properties b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_validation_preferences.properties
index d9aa84664c..cf1da4757e 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_validation_preferences.properties
+++ b/jpa/plugins/org.eclipse.jpt.ui/property_files/jpt_ui_validation_preferences.properties
@@ -130,6 +130,14 @@ VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPL
OVERRIDES_CATEGORY=Attribute/association overrides
IMPLIED_ATTRIBUTE_LEVEL_CATEGORY=Implied attributes
+ATTRIBUTE_OVERRIDE_INVALID_NAME=Attribute override name cannot be resolved to an attribute
+ASSOCIATION_OVERRIDE_INVALID_NAME=Association override name cannot be resolved to an attribute
+VIRTUAL_ATTRIBUTE_OVERRIDE_INVALID_NAME=Implied attribute override name cannot be resolved to an attribute
+VIRTUAL_ASSOCIATION_OVERRIDE_INVALID_NAME=Implied association override name cannot be resolved to an attribute
+VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME=Implied map key attribute override name cannot be resolved to an attribute
+VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_INVALID_NAME=Attribute override name cannot be resolved to an attribute
+VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVALID_NAME=Association override name cannot be resolved to an attribute
+VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME=Map key attribute override cannot be resolved to an attribute
VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=Implied map key attribute override table for column is not valid:
VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=Implied attribute override column cannot be resolved:
VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=Implied attribute override table for column not valid:
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiValidationPreferenceMessages.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiValidationPreferenceMessages.java
index e8242e6181..25fbb412b6 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiValidationPreferenceMessages.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/JptUiValidationPreferenceMessages.java
@@ -134,6 +134,14 @@ public class JptUiValidationPreferenceMessages {
public static String VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_CATALOG;
public static String VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA;
public static String VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME;
+ public static String ATTRIBUTE_OVERRIDE_INVALID_NAME;
+ public static String ASSOCIATION_OVERRIDE_INVALID_NAME;
+ public static String VIRTUAL_ATTRIBUTE_OVERRIDE_INVALID_NAME;
+ public static String VIRTUAL_ASSOCIATION_OVERRIDE_INVALID_NAME;
+ public static String VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME;
+ public static String VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_INVALID_NAME;
+ public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVALID_NAME;
+ public static String VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME;
public static String VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID;
public static String VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID;
public static String VIRTUAL_ATTRIBUTE_COLUMN_TABLE_NOT_VALID;
diff --git a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/preferences/JpaProblemSeveritiesPage.java b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/preferences/JpaProblemSeveritiesPage.java
index 13c3dc80fa..9db0bd2b57 100644
--- a/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/preferences/JpaProblemSeveritiesPage.java
+++ b/jpa/plugins/org.eclipse.jpt.ui/src/org/eclipse/jpt/ui/internal/preferences/JpaProblemSeveritiesPage.java
@@ -507,6 +507,11 @@ public class JpaProblemSeveritiesPage extends PropertyAndPreferencePage {
parent = addExpandableSection(parent, JptUiValidationPreferenceMessages.OVERRIDES_CATEGORY);
+ addLabeledCombo(parent, JptUiValidationPreferenceMessages.ATTRIBUTE_OVERRIDE_INVALID_NAME, JpaValidationMessages.ATTRIBUTE_OVERRIDE_INVALID_NAME);
+ addLabeledCombo(parent, JptUiValidationPreferenceMessages.ASSOCIATION_OVERRIDE_INVALID_NAME, JpaValidationMessages.ASSOCIATION_OVERRIDE_INVALID_NAME);
+ addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_INVALID_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_INVALID_NAME);
+ addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ASSOCIATION_OVERRIDE_INVALID_NAME, JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_INVALID_NAME);
+ addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME, JpaValidationMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME);
addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID);
addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME);
addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID);
@@ -527,6 +532,9 @@ public class JpaProblemSeveritiesPage extends PropertyAndPreferencePage {
parent = addSubExpandableSection(parent, JptUiValidationPreferenceMessages.IMPLIED_ATTRIBUTE_LEVEL_CATEGORY);
+ addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_INVALID_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_INVALID_NAME);
+ addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVALID_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVALID_NAME);
+ addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME);
addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID);
addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME);
addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID);

Back to the top