diff options
author | kmoore | 2012-02-29 20:27:31 +0000 |
---|---|---|
committer | kmoore | 2012-02-29 20:27:31 +0000 |
commit | d11dfc386ad9358dea800e9920769d2ad318e288 (patch) | |
tree | b7084bdfb591c475e5db191111905573146d0bb8 | |
parent | a2eb8167624399231efef1e998619d93e08e3cdb (diff) | |
download | webtools.dali-d11dfc386ad9358dea800e9920769d2ad318e288.tar.gz webtools.dali-d11dfc386ad9358dea800e9920769d2ad318e288.tar.xz webtools.dali-d11dfc386ad9358dea800e9920769d2ad318e288.zip |
bug 369944 - dynamic persistence - added validation for attribute-type on embedded, collections, and basics
58 files changed, 2753 insertions, 1355 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/property_files/jpa_validation.properties b/jpa/plugins/org.eclipse.jpt.jpa.core/property_files/jpa_validation.properties index df1c8de28c..38f41bfae2 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/property_files/jpa_validation.properties +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/property_files/jpa_validation.properties @@ -89,6 +89,7 @@ TYPE_MAPPING_PK_REDEFINED_ID_CLASS=An ancestor of this class has already defined ### Attributes ### MAP_KEY_CLASS_NOT_DEFINED=Map key class is not defined MAP_KEY_CLASS_NOT_EXIST=Map key class \"{0}\" does not exist +MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE=Map key class \"{0}\" is not an entity, embeddable or basic type ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST=Target class \"{0}\" does not exist ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE=Target class \"{0}\" is not an embeddable or basic type ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED=Target class is not defined @@ -123,7 +124,9 @@ PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME=Unspecified name TARGET_ENTITY_IS_NOT_AN_ENTITY=Target entity \"{0}\" is not an Entity TARGET_ENTITY_NOT_DEFINED=Target entity is not defined TARGET_ENTITY_NOT_EXIST=Target entity \"{0}\" does not exist +ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE=The attribute type for a collection mapping must be java.util.Collection, java.util.Set, java.util.List or java.util.Map VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_NOT_DEFINED=In implied attribute \"{0}\", map key class is not defined +VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE=In implied attribute \"{0}\", map key class \"{1}\" is not an entity, embeddable or basic type VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST="In implied attribute \"{0}\", target class does not exist on the classpath" VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_ELEMENT_COLLECTION_MAPPING=In implied attribute \"{0}"\, mapping contains an embeddable \"{1}\" with a prohibited mapping \"{2}\", element collections may not contain embeddables with element collection mappings VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_PROHIBITED_RELATIONSHIP_MAPPING=In implied attribute \"{0}"\, mapping contains an embeddable \"{1}\" with a prohibited mapping \"{2}\", embeddables in element collections may only contain many-to-one or one-to-one mappings which must be on the \"owning\" side of the relationship and not use a join table @@ -134,6 +137,8 @@ VIRTUAL_ATTRIBUTE_TARGET_ENTITY_NOT_DEFINED=In implied attribute \"{0}\", target VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE=In implied attribute \"{0}\", the map key for a Temporal type must be of type java.util.Date, java.util.Calendar or java.util.GregorianCalendar VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE=In implied attribute \"{0}\", the element collection value for a Temporal type must be of type java.util.Date, java.util.Calendar or java.util.GregorianCalendar VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE=In implied attribute \"{0}\", the persistent field or property for a Temporal type must be of type java.util.Date, java.util.Calendar or java.util.GregorianCalendar +VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE=In implied attribute \"{0}\", the attribute type for a collection mapping must be java.util.Collection, java.util.Set, java.util.List or java.util.Map +VIRTUAL_ATTRIBUTE_TARGET_NOT_AN_EMBEDDABLE=In implied attribute \"{0}\", \"{1}\" is not mapped as an embeddable VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_BE_PUBLIC=In implied attribute \"{0}\", embedded ID class should be public VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR=In implied attribute \"{0}\", embedded ID class should include a zero argument constructor VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_EQUALS_HASHCODE=In implied attribute \"{0}\", embedded ID class should include method definitions for equals() and hashcode() diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/OrmAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/OrmAttributeMapping.java index 9c298bf8fb..ca9ec5bfae 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/OrmAttributeMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/orm/OrmAttributeMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2010 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -44,6 +44,18 @@ public interface OrmAttributeMapping void setName(String name); String NAME_PROPERTY = "name"; //$NON-NLS-1$ + String getAttributeType(); + + String getFullyQualifiedAttributeType(); + String FULLY_QUALIFIED_ATTRIBUTE_TYPE_PROPERTY = "fullyQualifiedAttributeType"; //$NON-NLS-1$ + + String getSpecifiedAttributeType(); + void setSpecifiedAttributeType(String attributeType); + String SPECIFIED_ATTRIBUTE_TYPE_PROPERTY = "specifiedAttributeType"; //$NON-NLS-1$ + + String getDefaultAttributeType(); + String DEFAULT_ATTRIBUTE_TYPE_PROPERTY = "defaultAttributeType"; //$NON-NLS-1$ + /** * Attributes are a sequence in the <code>orm.xml</code> schema. We must keep * the list of attributes in the appropriate order so the WTP XML diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java index 8dca259ddc..ef53809060 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaBaseEmbeddedMapping.java @@ -220,8 +220,18 @@ public abstract class AbstractJavaBaseEmbeddedMapping<A extends Annotation> return true; } String targetEmbeddableTypeName = this.getPersistentAttribute().getTypeName(); - // if the type isn't resolvable, there will already be a java compile error - if (targetEmbeddableTypeName != null) { + if (this.getPersistentAttribute().isVirtual()) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.VIRTUAL_ATTRIBUTE_TARGET_NOT_AN_EMBEDDABLE, + new String[] {this.getName(), targetEmbeddableTypeName}, + this, + this.getValidationTextRange(astRoot) + ) + ); + } + else { messages.add( DefaultJpaValidationMessages.buildMessage( IMessage.HIGH_SEVERITY, diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java index 639dbd3329..ec33318805 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaMultiRelationshipMapping.java @@ -971,11 +971,49 @@ public abstract class AbstractJavaMultiRelationshipMapping<A extends Relationshi @Override public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { super.validate(messages, reporter, astRoot); + this.validateAttributeType(messages, reporter, astRoot); this.validateMapKeyClass(messages, astRoot); this.orderable.validate(messages, reporter, astRoot); this.validateMapKey(messages, reporter, astRoot); } + protected void validateAttributeType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + JavaPersistentAttribute javaAttribute = this.getJavaPersistentAttribute(); + if ((javaAttribute != null) && !javaAttribute.getJpaContainerDefinition().isContainer()) { + if (this.getPersistentAttribute().isVirtual()) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE, + new String[] {getName()}, + this, + this.getValidationTextRange(astRoot) + ) + ); + } + else { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE, + EMPTY_STRING_ARRAY, + this, + this.getValidationTextRange(astRoot) + ) + ); + } + } + } + + protected TextRange getMapKeyClassTextRange(CompilationUnit astRoot) { + return this.getValidationTextRange(this.getMapKeyClassAnnotationTextRange(astRoot), astRoot); + } + + protected TextRange getMapKeyClassAnnotationTextRange(CompilationUnit astRoot) { + MapKeyClass2_0Annotation annotation = this.getMapKeyClassAnnotation(); + return (annotation == null) ? null : annotation.getTextRange(astRoot); + } + protected void validateMapKey(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { if (this.getMapKeyAnnotation() != null) {//If MapKey annotation specified, no other MapKey* annotations can be specified, don't validate them //TODO validate that the map key refers to an existing attribute @@ -1025,6 +1063,36 @@ public abstract class AbstractJavaMultiRelationshipMapping<A extends Relationshi ) ); } + return; + } + + if (MappingTools.typeIsBasic(this.getJavaProject(), this.getFullyQualifiedMapKeyClass())) { + return; + } + + if (this.getResolvedMapKeyEmbeddable() == null && this.getResolvedMapKeyEntity() == null) { + if (this.getPersistentAttribute().isVirtual()) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE, + new String[] {this.getName(), this.getFullyQualifiedMapKeyClass()}, + this, + this.getMapKeyClassTextRange(astRoot) + ) + ); + } + else { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE, + new String[] {this.getFullyQualifiedMapKeyClass()}, + this, + this.getMapKeyClassTextRange(astRoot) + ) + ); + } } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmAttributeMapping.java index 561df09c02..0977325bda 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmAttributeMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmAttributeMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2011 Oracle. All rights reserved. + * Copyright (c) 2006, 2012 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. @@ -68,11 +68,16 @@ public abstract class AbstractOrmAttributeMapping<X extends XmlAttributeMapping> protected String name; + protected String specifiedAttributeType; + protected String defaultAttributeType; + protected String fullyQualifiedAttributeType; + protected AbstractOrmAttributeMapping(OrmPersistentAttribute parent, X xmlAttributeMapping) { super(parent); this.xmlAttributeMapping = xmlAttributeMapping; this.name = xmlAttributeMapping.getName(); + this.specifiedAttributeType = this.buildSpecifiedAttributeType(); } @@ -82,6 +87,14 @@ public abstract class AbstractOrmAttributeMapping<X extends XmlAttributeMapping> public void synchronizeWithResourceModel() { super.synchronizeWithResourceModel(); this.setName_(this.xmlAttributeMapping.getName()); + this.setSpecifiedAttributeType_(this.buildSpecifiedAttributeType()); + } + + @Override + public void update() { + super.update(); + this.setDefaultAttributeType(this.buildDefaultAttributeType()); + this.setFullyQualifiedAttributeType(this.buildFullyQualifiedAttributeType()); } @@ -106,10 +119,87 @@ public abstract class AbstractOrmAttributeMapping<X extends XmlAttributeMapping> } + // ********** fully-qualified attribute type ********** + + public String getFullyQualifiedAttributeType() { + return this.fullyQualifiedAttributeType; + } + + protected void setFullyQualifiedAttributeType(String entity) { + String old = this.fullyQualifiedAttributeType; + this.fullyQualifiedAttributeType = entity; + this.firePropertyChanged(FULLY_QUALIFIED_ATTRIBUTE_TYPE_PROPERTY, old, entity); + } + + protected String buildFullyQualifiedAttributeType() { + return (this.specifiedAttributeType == null) ? + this.defaultAttributeType : + this.getEntityMappings().getFullyQualifiedName(this.specifiedAttributeType); + } + + // ********** attribute type ********** + + public String getAttributeType() { + return (this.specifiedAttributeType != null) ? this.specifiedAttributeType : this.defaultAttributeType; + } + + public String getSpecifiedAttributeType() { + return this.specifiedAttributeType; + } + + public void setSpecifiedAttributeType(String attributeType) { + this.setSpecifiedAttributeType_(attributeType); + this.setSpecifiedAttributeTypeInXml(attributeType); + } + + protected void setSpecifiedAttributeType_(String attributeType) { + String old = this.specifiedAttributeType; + this.specifiedAttributeType = attributeType; + this.firePropertyChanged(SPECIFIED_ATTRIBUTE_TYPE_PROPERTY, old, attributeType); + } + + /** + * subclasses must override if they support specifying an attribute type + */ + protected void setSpecifiedAttributeTypeInXml(String attributeType) { + //no-op + } + + /** + * subclasses must override if they support specifying an attribute type + */ + protected String buildSpecifiedAttributeType() { + return null; + } + + public String getDefaultAttributeType() { + return this.defaultAttributeType; + } + + protected void setDefaultAttributeType(String attributeType) { + String old = this.defaultAttributeType; + this.defaultAttributeType = attributeType; + this.firePropertyChanged(DEFAULT_ATTRIBUTE_TYPE_PROPERTY, old, attributeType); + } + + protected String buildDefaultAttributeType() { + return (this.getJavaPersistentAttribute() == null) ? null : + this.getJavaPersistentAttribute().getTypeName(); + } + + protected PersistentType getResolvedAttributeType() { + if (this.fullyQualifiedAttributeType == null) { + return null; + } + return getPersistenceUnit().getPersistentType(this.fullyQualifiedAttributeType); + } + + // ********** morphing mappings ********** public void initializeFromOrmAttributeMapping(OrmAttributeMapping oldMapping) { this.setName(oldMapping.getName()); + this.setSpecifiedAttributeType(oldMapping.getSpecifiedAttributeType()); } protected void initializeFromOrmColumnMapping(OrmColumnMapping oldMapping) { diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java index 44781ee036..b678c0b2a3 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmBaseEmbeddedMapping.java @@ -22,11 +22,11 @@ import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer; import org.eclipse.jpt.jpa.core.context.Column; import org.eclipse.jpt.jpa.core.context.Embeddable; import org.eclipse.jpt.jpa.core.context.OverrideContainer; +import org.eclipse.jpt.jpa.core.context.PersistentType; import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride; import org.eclipse.jpt.jpa.core.context.ReadOnlyBaseColumn; import org.eclipse.jpt.jpa.core.context.ReadOnlyOverride; import org.eclipse.jpt.jpa.core.context.TypeMapping; -import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer; import org.eclipse.jpt.jpa.core.context.orm.OrmBaseEmbeddedMapping; import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute; @@ -108,11 +108,14 @@ public abstract class AbstractOrmBaseEmbeddedMapping<X extends AbstractXmlEmbedd } protected Embeddable buildTargetEmbeddable() { - JavaPersistentAttribute javaPersistentAttribute = getJavaPersistentAttribute(); - String typeName = (javaPersistentAttribute == null) ? null : javaPersistentAttribute.getSingleReferenceTargetTypeName(); - return (typeName == null) ? null : this.getPersistenceUnit().getEmbeddable(typeName); + TypeMapping typeMapping = this.getResolvedTargetTypeMapping(); + return (typeMapping instanceof Embeddable) ? (Embeddable) typeMapping : null; } + protected TypeMapping getResolvedTargetTypeMapping() { + PersistentType resolvedTargetType = this.getResolvedAttributeType(); + return (resolvedTargetType == null) ? null : resolvedTargetType.getMapping(); + } // ********** embedded mappings ********** @@ -204,23 +207,23 @@ public abstract class AbstractOrmBaseEmbeddedMapping<X extends AbstractXmlEmbedd } protected boolean validateTargetEmbeddable(List<IMessage> messages) { - if (this.targetEmbeddable == null) { - String targetEmbeddableTypeName = this.getPersistentAttribute().getTypeName(); - // if the type isn't resolvable, there'll already be a java error - if (targetEmbeddableTypeName != null) { - messages.add( - DefaultJpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - JpaValidationMessages.TARGET_NOT_AN_EMBEDDABLE, - new String[] {targetEmbeddableTypeName}, - this, - this.getValidationTextRange() - ) - ); - } - return false; + if (this.targetEmbeddable != null) { + return true; } - return true; + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.TARGET_NOT_AN_EMBEDDABLE, + new String[] {this.getFullyQualifiedAttributeType()}, + this, + this.getAttributeTypeTextRange() + ) + ); + return false; + } + + protected TextRange getAttributeTypeTextRange() { + return this.getValidationTextRange(); } protected void validateOverrides(List<IMessage> messages, IReporter reporter) { diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java index b4f51809e1..7e8727479f 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmMultiRelationshipMapping.java @@ -966,11 +966,31 @@ public abstract class AbstractOrmMultiRelationshipMapping<X extends AbstractXmlM @Override public void validate(List<IMessage> messages, IReporter reporter) { super.validate(messages, reporter); + this.validateAttributeType(messages, reporter); this.orderable.validate(messages, reporter); this.validateMapKeyClass(messages); this.validateMapKey(messages, reporter); } + protected void validateAttributeType(List<IMessage> messages, IReporter reporter) { + JavaPersistentAttribute javaAttribute = this.getJavaPersistentAttribute(); + if ((javaAttribute != null) && !javaAttribute.getJpaContainerDefinition().isContainer()) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE, + new String[] {this.getFullyQualifiedAttributeType()}, + this, + this.getAttributeTypeTextRange() + ) + ); + } + } + + protected TextRange getAttributeTypeTextRange() { + return this.getValidationTextRange(); + } + public void validateMapKey(List<IMessage> messages, IReporter reporter) { if (this.getMapKey() != null) { //TODO validate that the map key refers to an existing attribute @@ -993,7 +1013,7 @@ public abstract class AbstractOrmMultiRelationshipMapping<X extends AbstractXmlM protected void validateMapKeyClass(List<IMessage> messages) { if (this.isJpa2_0Compatible()) { - JavaPersistentAttribute javaAttribute = this.getJavaPersistentAttribute(); + JavaPersistentAttribute javaAttribute = this.getJavaPersistentAttribute(); if ((javaAttribute != null) && javaAttribute.getJpaContainerDefinition().isMap()) { this.validateMapKeyClass_(messages); } @@ -1014,18 +1034,35 @@ public abstract class AbstractOrmMultiRelationshipMapping<X extends AbstractXmlM return; } - IType mapKeyJdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedMapKeyClass()); - if (mapKeyJdtType == null) { + if (MappingTools.typeIsBasic(this.getJavaProject(), this.getFullyQualifiedMapKeyClass())) { + return; + } + + if (this.getResolvedMapKeyType() == null) { + IType mapKeyJdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedMapKeyClass()); + if (mapKeyJdtType == null) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.MAP_KEY_CLASS_NOT_EXIST, + new String[] {this.getFullyQualifiedMapKeyClass()}, + this, + this.getMapKeyClassTextRange() + ) + ); + } + return; + } + if (this.getResolvedMapKeyEmbeddable() == null && this.getResolvedMapKeyEntity() == null) { messages.add( DefaultJpaValidationMessages.buildMessage( IMessage.HIGH_SEVERITY, - JpaValidationMessages.MAP_KEY_CLASS_NOT_EXIST, + JpaValidationMessages.MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE, new String[] {this.getFullyQualifiedMapKeyClass()}, this, this.getMapKeyClassTextRange() ) ); - return; } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmRelationshipMapping.java index dc5c664ff3..00084c9d5d 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmRelationshipMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmRelationshipMapping.java @@ -402,19 +402,19 @@ public abstract class AbstractOrmRelationshipMapping<X extends AbstractXmlRelati ); return; } - IType jdtType = JDTTools.findType(getJavaProject(), this.getFullyQualifiedTargetEntity()); - //If a persistent type exists, but no underlying java class, then - //you will get validation on that persistent type instead of here - if (jdtType == null && this.getResolvedTargetType() == null) { - messages.add( - DefaultJpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - JpaValidationMessages.TARGET_ENTITY_NOT_EXIST, - new String[] {this.getFullyQualifiedTargetEntity()}, - this, - this.getTargetEntityTextRange() - ) - ); + if (this.getResolvedTargetType() == null) { + IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedTargetEntity()); + if (jdtType == null) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.TARGET_ENTITY_NOT_EXIST, + new String[] {this.getFullyQualifiedTargetEntity()}, + this, + this.getTargetEntityTextRange() + ) + ); + } return; } if (this.getResolvedTargetEntity() == null) { diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmVersionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmVersionMapping.java index 3e7c20c243..7750709141 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmVersionMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractOrmVersionMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 Oracle. All rights reserved. + * Copyright (c) 2007, 2012 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. @@ -275,7 +275,7 @@ public abstract class AbstractOrmVersionMapping<X extends XmlVersion> } protected void validateAttributeType(List<IMessage> messages) { - if (!ArrayTools.contains(SUPPORTED_TYPE_NAMES, this.getPersistentAttribute().getTypeName())) { + if (!ArrayTools.contains(SUPPORTED_TYPE_NAMES, this.getAttributeType())) { messages.add( DefaultJpaValidationMessages.buildMessage( IMessage.NORMAL_SEVERITY, diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentAttribute.java index 660c88a934..2a0b7f0ab0 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentAttribute.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentAttribute.java @@ -558,7 +558,7 @@ public abstract class SpecifiedOrmPersistentAttribute } public String getTypeName() { - return (this.javaPersistentAttribute == null) ? null : this.javaPersistentAttribute.getTypeName(); + return this.mapping.getAttributeType(); } @Override diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/AbstractOrmEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/AbstractOrmEmbeddedIdMapping.java new file mode 100644 index 0000000000..41ce9cc85b --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/AbstractOrmEmbeddedIdMapping.java @@ -0,0 +1,262 @@ +/******************************************************************************* + * Copyright (c) 2012 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.jpa.core.internal.jpa1.context.orm; + +import java.io.Serializable; +import java.util.List; +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jpt.common.core.internal.utility.JDTTools; +import org.eclipse.jpt.common.core.resource.java.JavaResourceType; +import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; +import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable; +import org.eclipse.jpt.jpa.core.MappingKeys; +import org.eclipse.jpt.jpa.core.context.TypeMapping; +import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping; +import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer; +import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedIdMapping; +import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute; +import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmBaseEmbeddedMapping; +import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages; +import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages; +import org.eclipse.jpt.jpa.core.jpa2.context.EmbeddedIdMapping2_0; +import org.eclipse.jpt.jpa.core.resource.orm.Attributes; +import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddedId; +import org.eclipse.wst.validation.internal.provisional.core.IMessage; +import org.eclipse.wst.validation.internal.provisional.core.IReporter; + +/** + * <code>orm.xml</code> embedded ID mapping + */ +public abstract class AbstractOrmEmbeddedIdMapping<X extends XmlEmbeddedId> + extends AbstractOrmBaseEmbeddedMapping<X> + implements EmbeddedIdMapping2_0, OrmEmbeddedIdMapping +{ + /* JPA 2.0 - the embedded id may be derived from a relationship */ + protected boolean derived; + + + protected AbstractOrmEmbeddedIdMapping(OrmPersistentAttribute parent, X xmlMapping) { + super(parent, xmlMapping); + } + + + // ********** synchronize/update ********** + + @Override + public void update() { + super.update(); + this.setMappedByRelationship(this.buildDerived()); + } + + + // ********** derived ********** + + public boolean isDerived() { + return this.derived; + } + + protected void setMappedByRelationship(boolean derived) { + boolean old = this.derived; + this.derived = derived; + this.firePropertyChanged(DERIVED_PROPERTY, old, derived); + } + + protected boolean buildDerived() { + return this.isJpa2_0Compatible() && this.buildDerived_(); + } + + protected boolean buildDerived_() { + return this.getTypeMapping().attributeIsDerivedId(this.name); + } + + + // ********** misc ********** + + public String getKey() { + return MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY; + } + + public int getXmlSequence() { + return 10; + } + + public void initializeOn(OrmAttributeMapping newMapping) { + newMapping.initializeFromOrmEmbeddedIdMapping(this); + } + + public void addXmlAttributeMappingTo(Attributes xmlAttributes) { + xmlAttributes.getEmbeddedIds().add(this.xmlAttributeMapping); + } + + public void removeXmlAttributeMappingFrom(Attributes xmlAttributes) { + xmlAttributes.getEmbeddedIds().remove(this.xmlAttributeMapping); + } + + @Override + protected Iterable<String> getEmbeddableOverridableAttributeMappingNames() { + return this.derived ? + EmptyIterable.<String>instance() : + super.getEmbeddableOverridableAttributeMappingNames(); + } + + @Override + protected OrmAttributeOverrideContainer.Owner buildAttributeOverrideContainerOwner() { + return new AttributeOverrideContainerOwner(); + } + + + // ********** validation ********** + + @Override + public void validate(List<IMessage> messages, IReporter reporter) { + super.validate(messages, reporter); + validateMappedByRelationshipAndAttributeOverridesSpecified(messages, reporter); + validateTargetEmbeddableImplementsEqualsAndHashcode(messages, reporter); + validateTargetEmbeddableIsPublic(messages, reporter); + validateTargetEmbeddableImplementsSerializable(messages, reporter); + validateNoRelationshipMappingsOnTargetEmbeddable(messages, reporter); + validateTargetEmbeddableImplementsNoArgConstructor(messages, reporter); + } + + protected void validateNoRelationshipMappingsOnTargetEmbeddable(List<IMessage> messages, IReporter reporter) { + if (this.getTargetEmbeddable() != null) { + TypeMapping targetEmbeddableTypeMapping = this.getTargetEmbeddable().getPersistentType().getMapping(); + if (targetEmbeddableTypeMapping.getAllAttributeMappings(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY).iterator().hasNext() + || targetEmbeddableTypeMapping.getAllAttributeMappings(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY).iterator().hasNext() + || targetEmbeddableTypeMapping.getAllAttributeMappings(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY).iterator().hasNext() + || targetEmbeddableTypeMapping.getAllAttributeMappings(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY).iterator().hasNext()) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS, + EMPTY_STRING_ARRAY, + this, + this.getValidationTextRange() + ) + ); + } + } + } + + protected void validateTargetEmbeddableImplementsSerializable(List<IMessage> messages, IReporter reporter) { + if (this.getTargetEmbeddable() != null) { + String targetEmbeddableClassName = this.getTargetEmbeddable().getPersistentType().getName(); + IJavaProject javaProject = getJpaProject().getJavaProject(); + if (!JDTTools.typeIsSubType(javaProject, targetEmbeddableClassName, Serializable.class.getName())) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_SERIALIZABLE, + EMPTY_STRING_ARRAY, + this, + this.getValidationTextRange() + ) + ); + } + } + } + + protected void validateTargetEmbeddableIsPublic(List<IMessage> messages, IReporter reporter) { + if (this.getTargetEmbeddable() != null) { + if (!getTargetEmbeddable().getJavaResourceType().isPublic()) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.EMBEDDED_ID_CLASS_SHOULD_BE_PUBLIC, + EMPTY_STRING_ARRAY, + this, + this.getValidationTextRange() + ) + ); + } + } + } + + protected void validateTargetEmbeddableImplementsEqualsAndHashcode(List<IMessage> messages, IReporter reporter) { + if (this.getTargetEmbeddable() != null) { + JavaResourceType resourceType = getTargetEmbeddable().getJavaResourceType(); + if (resourceType != null + && (!resourceType.hasHashCodeMethod() || !resourceType.hasEqualsMethod())) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_EQUALS_HASHCODE, + EMPTY_STRING_ARRAY, + this, + this.getValidationTextRange() + ) + ); + } + } + } + + protected void validateTargetEmbeddableImplementsNoArgConstructor(List<IMessage> messages, IReporter reporter) { + if (this.getTargetEmbeddable() != null) { + String targetEmbeddableClassName = this.getTargetEmbeddable().getPersistentType().getName(); + IJavaProject javaProject = getJpaProject().getJavaProject(); + if (!JDTTools.classHasPublicZeroArgConstructor(javaProject, targetEmbeddableClassName)) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR, + EMPTY_STRING_ARRAY, + this, + this.getValidationTextRange() + ) + ); + } + } + } + + protected void validateMappedByRelationshipAndAttributeOverridesSpecified(List<IMessage> messages, IReporter reporter) { + // [JPA 2.0] if the embedded id is mapped by a relationship, then any specified + // attribute overrides are in error + // (in JPA 1.0, this will obviously never be reached) + if (this.derived + && (this.attributeOverrideContainer.getSpecifiedOverridesSize() > 0)) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED, + EMPTY_STRING_ARRAY, + this.attributeOverrideContainer, + this.attributeOverrideContainer.getValidationTextRange() + ) + ); + } + } + + + // ********** attribute override container owner ********* + + protected class AttributeOverrideContainerOwner + extends AbstractOrmBaseEmbeddedMapping<XmlEmbeddedId>.AttributeOverrideContainerOwner + { + @Override + public Iterable<String> getAllOverridableNames() { + return AbstractOrmEmbeddedIdMapping.this.isDerived() ? + EmptyIterable.<String>instance() : + super.getAllOverridableNames(); + } + + /** + * pre-condition: type mapping is not <code>null</code> + */ + @Override + protected Iterable<String> getAllOverridableAttributeNames_(TypeMapping overriddenTypeMapping) { + return new FilteringIterable<String>(super.getAllOverridableAttributeNames_(overriddenTypeMapping)) { + @Override + protected boolean accept(String attributeName) { + return ! AttributeOverrideContainerOwner.this.getTypeMapping().attributeIsDerivedId(attributeName); + } + }; + } + } +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/AbstractOrmEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/AbstractOrmEmbeddedMapping.java new file mode 100644 index 0000000000..f60f1c7e87 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/AbstractOrmEmbeddedMapping.java @@ -0,0 +1,311 @@ +/******************************************************************************* + * Copyright (c) 2012 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.jpa.core.internal.jpa1.context.orm; + +import java.util.List; +import org.eclipse.emf.common.util.EList; +import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; +import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; +import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable; +import org.eclipse.jpt.common.utility.internal.iterables.SubIterableWrapper; +import org.eclipse.jpt.jpa.core.MappingKeys; +import org.eclipse.jpt.jpa.core.context.AssociationOverride; +import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer; +import org.eclipse.jpt.jpa.core.context.AttributeMapping; +import org.eclipse.jpt.jpa.core.context.OverrideContainer; +import org.eclipse.jpt.jpa.core.context.ReadOnlyAssociationOverride; +import org.eclipse.jpt.jpa.core.context.ReadOnlyBaseColumn; +import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn; +import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinTable; +import org.eclipse.jpt.jpa.core.context.ReadOnlyOverride; +import org.eclipse.jpt.jpa.core.context.ReadOnlyTable; +import org.eclipse.jpt.jpa.core.context.Relationship; +import org.eclipse.jpt.jpa.core.context.RelationshipMapping; +import org.eclipse.jpt.jpa.core.context.TypeMapping; +import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer; +import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping; +import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer; +import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute; +import org.eclipse.jpt.jpa.core.context.orm.OrmTypeMapping; +import org.eclipse.jpt.jpa.core.internal.context.AttributeMappingTools; +import org.eclipse.jpt.jpa.core.internal.context.TableColumnTextRangeResolver; +import org.eclipse.jpt.jpa.core.internal.context.JoinColumnTextRangeResolver; +import org.eclipse.jpt.jpa.core.internal.context.JptValidator; +import org.eclipse.jpt.jpa.core.internal.context.MappingTools; +import org.eclipse.jpt.jpa.core.internal.context.OverrideTextRangeResolver; +import org.eclipse.jpt.jpa.core.internal.context.TableTextRangeResolver; +import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmBaseEmbeddedMapping; +import org.eclipse.jpt.jpa.core.internal.jpa1.context.AssociationOverrideInverseJoinColumnValidator; +import org.eclipse.jpt.jpa.core.internal.jpa1.context.AssociationOverrideJoinColumnValidator; +import org.eclipse.jpt.jpa.core.internal.jpa1.context.AssociationOverrideJoinTableValidator; +import org.eclipse.jpt.jpa.core.internal.jpa1.context.AssociationOverrideValidator; +import org.eclipse.jpt.jpa.core.internal.jpa1.context.EmbeddableOverrideDescriptionProvider; +import org.eclipse.jpt.jpa.core.internal.jpa1.context.EntityTableDescriptionProvider; +import org.eclipse.jpt.jpa.core.internal.jpa1.context.JoinTableTableDescriptionProvider; +import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmAssociationOverrideContainer2_0; +import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmEmbeddedMapping2_0; +import org.eclipse.jpt.jpa.core.resource.orm.Attributes; +import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride; +import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedded; +import org.eclipse.wst.validation.internal.provisional.core.IMessage; +import org.eclipse.wst.validation.internal.provisional.core.IReporter; + +/** + * <code>orm.xml</code> embedded mapping + */ +public abstract class AbstractOrmEmbeddedMapping<X extends XmlEmbedded> + extends AbstractOrmBaseEmbeddedMapping<X> + implements OrmEmbeddedMapping2_0 +{ + protected final OrmAssociationOverrideContainer associationOverrideContainer; + + + protected AbstractOrmEmbeddedMapping(OrmPersistentAttribute parent, X xmlMapping) { + super(parent, xmlMapping); + this.associationOverrideContainer = this.buildAssociationOverrideContainer(); + } + + + // ********** synchronize/update ********** + + @Override + public void synchronizeWithResourceModel() { + super.synchronizeWithResourceModel(); + this.associationOverrideContainer.synchronizeWithResourceModel(); + } + + @Override + public void update() { + super.update(); + this.associationOverrideContainer.update(); + } + + + // ********** association override container ********** + + public OrmAssociationOverrideContainer getAssociationOverrideContainer() { + return this.associationOverrideContainer; + } + + protected OrmAssociationOverrideContainer buildAssociationOverrideContainer() { + return this.isOrmXml2_0Compatible() ? + this.getContextNodeFactory2_0().buildOrmAssociationOverrideContainer(this, this.buildAssociationOverrideContainerOwner()) : + new GenericOrmAssociationOverrideContainer(this, null); + } + + protected OrmAssociationOverrideContainer2_0.Owner buildAssociationOverrideContainerOwner() { + return new AssociationOverrideContainerOwner(); + } + + + // ********** embedded mappings ********** + + /** + * This is only to build the choices for a "mapped by" setting in a + * relationship mapping. JPA 2.0 does not support relationship mappings + * in an embedded ID class; so we only put this logic here. + */ + @Override + @SuppressWarnings("unchecked") + public Iterable<String> getAllMappingNames() { + return this.isJpa2_0Compatible() ? + new CompositeIterable<String>(super.getAllMappingNames(), this.getAllEmbeddableAttributeMappingNames()) : + super.getAllMappingNames(); + } + + protected Iterable<String> getAllEmbeddableAttributeMappingNames() { + return this.getQualifiedEmbeddableOverridableMappingNames(AttributeMappingTools.ALL_MAPPING_NAMES_TRANSFORMER); + } + + protected Iterable<RelationshipMapping> allOverridableAssociations() { + return (this.targetEmbeddable != null) ? + new SubIterableWrapper<AttributeMapping, RelationshipMapping>(this.getAllOverridableAssociations_()) : + EmptyIterable.<RelationshipMapping>instance(); + } + + protected Iterable<AttributeMapping> getAllOverridableAssociations_() { + return new FilteringIterable<AttributeMapping>(this.targetEmbeddable.getAttributeMappings()) { + @Override + protected boolean accept(AttributeMapping attributeMapping) { + return attributeMapping.isOverridableAssociationMapping(); + } + }; + } + + @Override + public AttributeMapping resolveAttributeMapping(String attributeName) { + AttributeMapping resolvedMapping = super.resolveAttributeMapping(attributeName); + if (resolvedMapping != null) { + return resolvedMapping; + } + return this.isJpa2_0Compatible() ? this.resolveAttributeMapping_(attributeName) : null; + } + + protected AttributeMapping resolveAttributeMapping_(String attributeName) { + attributeName = this.unqualify(attributeName); + if (attributeName == null) { + return null; + } + // recurse into the embeddable mappings + for (AttributeMapping mapping : this.getEmbeddableAttributeMappings()) { + AttributeMapping resolvedMapping = mapping.resolveAttributeMapping(attributeName); + if (resolvedMapping != null) { + return resolvedMapping; + } + } + return null; + } + + + // ********** misc ********** + + public String getKey() { + return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY; + } + + public int getXmlSequence() { + return 80; + } + + public void initializeOn(OrmAttributeMapping newMapping) { + newMapping.initializeFromOrmEmbeddedMapping(this); + } + + public void addXmlAttributeMappingTo(Attributes xmlAttributes) { + xmlAttributes.getEmbeddeds().add(this.xmlAttributeMapping); + } + + public void removeXmlAttributeMappingFrom(Attributes xmlAttributes) { + xmlAttributes.getEmbeddeds().remove(this.xmlAttributeMapping); + } + + @Override + public Relationship resolveOverriddenRelationship(String attributeName) { + return this.isJpa2_0Compatible() ? this.resolveOverriddenRelationship_(attributeName) : null; + } + + protected Relationship resolveOverriddenRelationship_(String attributeName) { + attributeName = this.unqualify(attributeName); + if (attributeName == null) { + return null; + } + AssociationOverride override = this.associationOverrideContainer.getSpecifiedOverrideNamed(attributeName); + // recurse into the target embeddable if necessary + return (override != null) ? override.getRelationship() : this.resolveOverriddenRelationshipInTargetEmbeddable(attributeName); + } + + protected Relationship resolveOverriddenRelationshipInTargetEmbeddable(String attributeName) { + return (this.targetEmbeddable == null) ? null : this.targetEmbeddable.resolveOverriddenRelationship(attributeName); + } + + @Override + protected OrmAttributeOverrideContainer.Owner buildAttributeOverrideContainerOwner() { + return new AttributeOverrideContainerOwner(); + } + + + // ********** validation ********** + + @Override + protected void validateOverrides(List<IMessage> messages, IReporter reporter) { + super.validateOverrides(messages, reporter); + this.associationOverrideContainer.validate(messages, reporter); + } + + + // ********** attribute override container owner ********* + + protected class AttributeOverrideContainerOwner + extends AbstractOrmBaseEmbeddedMapping<XmlEmbedded>.AttributeOverrideContainerOwner + { + // nothing yet + } + + + // ********** association override container owner ********** + + protected class AssociationOverrideContainerOwner + implements OrmAssociationOverrideContainer2_0.Owner + { + protected String getMappingName() { + return AbstractOrmEmbeddedMapping.this.getName(); + } + + public OrmTypeMapping getTypeMapping() { + return AbstractOrmEmbeddedMapping.this.getTypeMapping(); + } + + public TypeMapping getOverridableTypeMapping() { + return AbstractOrmEmbeddedMapping.this.getTargetEmbeddable(); + } + + public Iterable<String> getAllOverridableNames() { + TypeMapping typeMapping = this.getOverridableTypeMapping(); + return (typeMapping != null) ? typeMapping.getAllOverridableAssociationNames() : EmptyIterable.<String>instance(); + } + + public Iterable<String> getJavaOverrideNames() { + return null; + } + + public EList<XmlAssociationOverride> getXmlOverrides() { + return AbstractOrmEmbeddedMapping.this.getXmlAttributeMapping().getAssociationOverrides(); + } + + public Relationship resolveOverriddenRelationship(String attributeName) { + return MappingTools.resolveOverriddenRelationship(this.getOverridableTypeMapping(), attributeName); + } + + public boolean tableNameIsInvalid(String tableName) { + return this.getTypeMapping().tableNameIsInvalid(tableName); + } + + public Iterable<String> getCandidateTableNames() { + return this.getTypeMapping().getAllAssociatedTableNames(); + } + + public org.eclipse.jpt.jpa.db.Table resolveDbTable(String tableName) { + return this.getTypeMapping().resolveDbTable(tableName); + } + + public String getDefaultTableName() { + return this.getTypeMapping().getPrimaryTableName(); + } + + public TextRange getValidationTextRange() { + return AbstractOrmEmbeddedMapping.this.getValidationTextRange(); + } + + public JptValidator buildOverrideValidator(ReadOnlyOverride override, OverrideContainer container, OverrideTextRangeResolver textRangeResolver) { + return new AssociationOverrideValidator(this.getPersistentAttribute(), (ReadOnlyAssociationOverride) override, (AssociationOverrideContainer) container, textRangeResolver, new EmbeddableOverrideDescriptionProvider()); + } + + public JptValidator buildColumnValidator(ReadOnlyOverride override, ReadOnlyBaseColumn column, ReadOnlyBaseColumn.Owner owner, TableColumnTextRangeResolver textRangeResolver) { + return new AssociationOverrideJoinColumnValidator(this.getPersistentAttribute(), (ReadOnlyAssociationOverride) override, (ReadOnlyJoinColumn) column, (ReadOnlyJoinColumn.Owner) owner, (JoinColumnTextRangeResolver) textRangeResolver, new EntityTableDescriptionProvider()); + } + + public JptValidator buildJoinTableJoinColumnValidator(ReadOnlyAssociationOverride override, ReadOnlyJoinColumn column, ReadOnlyJoinColumn.Owner owner, JoinColumnTextRangeResolver textRangeResolver) { + return new AssociationOverrideJoinColumnValidator(this.getPersistentAttribute(), override, column, owner, textRangeResolver, new JoinTableTableDescriptionProvider()); + } + + public JptValidator buildJoinTableInverseJoinColumnValidator(ReadOnlyAssociationOverride override, ReadOnlyJoinColumn column, ReadOnlyJoinColumn.Owner owner, JoinColumnTextRangeResolver textRangeResolver) { + return new AssociationOverrideInverseJoinColumnValidator(this.getPersistentAttribute(), override, column, owner, textRangeResolver, new JoinTableTableDescriptionProvider()); + } + + public JptValidator buildJoinTableValidator(ReadOnlyAssociationOverride override, ReadOnlyTable table, TableTextRangeResolver textRangeResolver) { + return new AssociationOverrideJoinTableValidator(this.getPersistentAttribute(), override, (ReadOnlyJoinTable) table, textRangeResolver); + } + + protected OrmPersistentAttribute getPersistentAttribute() { + return AbstractOrmEmbeddedMapping.this.getPersistentAttribute(); + } + } +} diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmEmbeddedIdMapping.java index a57c652994..ffa8df64d6 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmEmbeddedIdMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmEmbeddedIdMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 Oracle. All rights reserved. + * Copyright (c) 2007, 2012 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. @@ -9,253 +9,17 @@ ******************************************************************************/ package org.eclipse.jpt.jpa.core.internal.jpa1.context.orm; -import java.io.Serializable; -import java.util.List; - -import org.eclipse.jdt.core.IJavaProject; -import org.eclipse.jpt.common.core.internal.utility.JDTTools; -import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; -import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable; -import org.eclipse.jpt.jpa.core.MappingKeys; -import org.eclipse.jpt.jpa.core.context.TypeMapping; -import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping; -import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer; -import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedIdMapping; import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute; -import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmBaseEmbeddedMapping; -import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages; -import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages; -import org.eclipse.jpt.jpa.core.jpa2.context.EmbeddedIdMapping2_0; -import org.eclipse.jpt.jpa.core.resource.orm.Attributes; import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddedId; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; -import org.eclipse.wst.validation.internal.provisional.core.IReporter; /** * <code>orm.xml</code> embedded ID mapping */ public class GenericOrmEmbeddedIdMapping - extends AbstractOrmBaseEmbeddedMapping<XmlEmbeddedId> - implements EmbeddedIdMapping2_0, OrmEmbeddedIdMapping + extends AbstractOrmEmbeddedIdMapping<XmlEmbeddedId> { - /* JPA 2.0 - the embedded id may be derived from a relationship */ - protected boolean derived; - public GenericOrmEmbeddedIdMapping(OrmPersistentAttribute parent, XmlEmbeddedId xmlMapping) { super(parent, xmlMapping); } - - - // ********** synchronize/update ********** - - @Override - public void update() { - super.update(); - this.setMappedByRelationship(this.buildDerived()); - } - - - // ********** derived ********** - - public boolean isDerived() { - return this.derived; - } - - protected void setMappedByRelationship(boolean derived) { - boolean old = this.derived; - this.derived = derived; - this.firePropertyChanged(DERIVED_PROPERTY, old, derived); - } - - protected boolean buildDerived() { - return this.isJpa2_0Compatible() && this.buildDerived_(); - } - - protected boolean buildDerived_() { - return this.getTypeMapping().attributeIsDerivedId(this.name); - } - - - // ********** misc ********** - - public String getKey() { - return MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY; - } - - public int getXmlSequence() { - return 10; - } - - public void initializeOn(OrmAttributeMapping newMapping) { - newMapping.initializeFromOrmEmbeddedIdMapping(this); - } - - public void addXmlAttributeMappingTo(Attributes xmlAttributes) { - xmlAttributes.getEmbeddedIds().add(this.xmlAttributeMapping); - } - - public void removeXmlAttributeMappingFrom(Attributes xmlAttributes) { - xmlAttributes.getEmbeddedIds().remove(this.xmlAttributeMapping); - } - - @Override - protected Iterable<String> getEmbeddableOverridableAttributeMappingNames() { - return this.derived ? - EmptyIterable.<String>instance() : - super.getEmbeddableOverridableAttributeMappingNames(); - } - - @Override - protected OrmAttributeOverrideContainer.Owner buildAttributeOverrideContainerOwner() { - return new AttributeOverrideContainerOwner(); - } - - - // ********** validation ********** - - @Override - public void validate(List<IMessage> messages, IReporter reporter) { - super.validate(messages, reporter); - validateMappedByRelationshipAndAttributeOverridesSpecified(messages, reporter); - validateTargetEmbeddableImplementsEqualsAndHashcode(messages, reporter); - validateTargetEmbeddableIsPublic(messages, reporter); - validateTargetEmbeddableImplementsSerializable(messages, reporter); - validateNoRelationshipMappingsOnTargetEmbeddable(messages, reporter); - validateTargetEmbeddableImplementsNoArgConstructor(messages, reporter); - } - - protected void validateNoRelationshipMappingsOnTargetEmbeddable(List<IMessage> messages, IReporter reporter) { - if (this.getTargetEmbeddable() != null) { - TypeMapping targetEmbeddableTypeMapping = this.getTargetEmbeddable().getPersistentType().getMapping(); - if (targetEmbeddableTypeMapping.getAllAttributeMappings(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY).iterator().hasNext() - || targetEmbeddableTypeMapping.getAllAttributeMappings(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY).iterator().hasNext() - || targetEmbeddableTypeMapping.getAllAttributeMappings(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY).iterator().hasNext() - || targetEmbeddableTypeMapping.getAllAttributeMappings(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY).iterator().hasNext()) { - messages.add( - DefaultJpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - JpaValidationMessages.EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS, - EMPTY_STRING_ARRAY, - this, - this.getValidationTextRange() - ) - ); - } - } - } - - protected void validateTargetEmbeddableImplementsSerializable(List<IMessage> messages, IReporter reporter) { - if (this.getTargetEmbeddable() != null) { - String targetEmbeddableClassName = this.getTargetEmbeddable().getPersistentType().getName(); - IJavaProject javaProject = getJpaProject().getJavaProject(); - if (!JDTTools.typeIsSubType(javaProject, targetEmbeddableClassName, Serializable.class.getName())) { - messages.add( - DefaultJpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - JpaValidationMessages.EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_SERIALIZABLE, - EMPTY_STRING_ARRAY, - this, - this.getValidationTextRange() - ) - ); - } - } - } - - protected void validateTargetEmbeddableIsPublic(List<IMessage> messages, IReporter reporter) { - if (this.getTargetEmbeddable() != null) { - if (!getTargetEmbeddable().getJavaResourceType().isPublic()) { - messages.add( - DefaultJpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - JpaValidationMessages.EMBEDDED_ID_CLASS_SHOULD_BE_PUBLIC, - EMPTY_STRING_ARRAY, - this, - this.getValidationTextRange() - ) - ); - } - } - } - - protected void validateTargetEmbeddableImplementsEqualsAndHashcode(List<IMessage> messages, IReporter reporter) { - if (this.getTargetEmbeddable() != null) { - String targetEmbeddableClassName = this.getTargetEmbeddable().getPersistentType().getName(); - IJavaProject javaProject = getJpaProject().getJavaProject(); - if (!JDTTools.typeNamedImplementsMethod(javaProject, targetEmbeddableClassName, "equals", new String[] {Object.class.getName()}) - || !JDTTools.typeNamedImplementsMethod(javaProject, targetEmbeddableClassName, "hashCode", EMPTY_STRING_ARRAY)) { - messages.add( - DefaultJpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - JpaValidationMessages.EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_EQUALS_HASHCODE, - EMPTY_STRING_ARRAY, - this, - this.getValidationTextRange() - ) - ); - } - } - } - - protected void validateTargetEmbeddableImplementsNoArgConstructor(List<IMessage> messages, IReporter reporter) { - if (this.getTargetEmbeddable() != null) { - String targetEmbeddableClassName = this.getTargetEmbeddable().getPersistentType().getName(); - IJavaProject javaProject = getJpaProject().getJavaProject(); - if (!JDTTools.classHasPublicZeroArgConstructor(javaProject, targetEmbeddableClassName)) { - messages.add( - DefaultJpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - JpaValidationMessages.EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR, - EMPTY_STRING_ARRAY, - this, - this.getValidationTextRange() - ) - ); - } - } - } - - protected void validateMappedByRelationshipAndAttributeOverridesSpecified(List<IMessage> messages, IReporter reporter) { - // [JPA 2.0] if the embedded id is mapped by a relationship, then any specified - // attribute overrides are in error - // (in JPA 1.0, this will obviously never be reached) - if (this.derived - && (this.attributeOverrideContainer.getSpecifiedOverridesSize() > 0)) { - messages.add( - DefaultJpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - JpaValidationMessages.EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED, - EMPTY_STRING_ARRAY, - this.attributeOverrideContainer, - this.attributeOverrideContainer.getValidationTextRange() - ) - ); - } - } - // ********** attribute override container owner ********* - - protected class AttributeOverrideContainerOwner - extends AbstractOrmBaseEmbeddedMapping<XmlEmbeddedId>.AttributeOverrideContainerOwner - { - @Override - public Iterable<String> getAllOverridableNames() { - return GenericOrmEmbeddedIdMapping.this.isDerived() ? - EmptyIterable.<String>instance() : - super.getAllOverridableNames(); - } - - /** - * pre-condition: type mapping is not <code>null</code> - */ - @Override - protected Iterable<String> getAllOverridableAttributeNames_(TypeMapping overriddenTypeMapping) { - return new FilteringIterable<String>(super.getAllOverridableAttributeNames_(overriddenTypeMapping)) { - @Override - protected boolean accept(String attributeName) { - return ! AttributeOverrideContainerOwner.this.getTypeMapping().attributeIsDerivedId(attributeName); - } - }; - } - } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmEmbeddedMapping.java index 2c3607adb4..3266c65927 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmEmbeddedMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmEmbeddedMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2011 Oracle. All rights reserved. + * Copyright (c) 2007, 2012 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. @@ -9,303 +9,16 @@ ******************************************************************************/ package org.eclipse.jpt.jpa.core.internal.jpa1.context.orm; -import java.util.List; -import org.eclipse.emf.common.util.EList; -import org.eclipse.jpt.common.core.utility.TextRange; -import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; -import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; -import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable; -import org.eclipse.jpt.common.utility.internal.iterables.SubIterableWrapper; -import org.eclipse.jpt.jpa.core.MappingKeys; -import org.eclipse.jpt.jpa.core.context.AssociationOverride; -import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer; -import org.eclipse.jpt.jpa.core.context.AttributeMapping; -import org.eclipse.jpt.jpa.core.context.OverrideContainer; -import org.eclipse.jpt.jpa.core.context.ReadOnlyAssociationOverride; -import org.eclipse.jpt.jpa.core.context.ReadOnlyBaseColumn; -import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn; -import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinTable; -import org.eclipse.jpt.jpa.core.context.ReadOnlyOverride; -import org.eclipse.jpt.jpa.core.context.ReadOnlyTable; -import org.eclipse.jpt.jpa.core.context.Relationship; -import org.eclipse.jpt.jpa.core.context.RelationshipMapping; -import org.eclipse.jpt.jpa.core.context.TypeMapping; -import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer; -import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping; -import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer; import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute; -import org.eclipse.jpt.jpa.core.context.orm.OrmTypeMapping; -import org.eclipse.jpt.jpa.core.internal.context.AttributeMappingTools; -import org.eclipse.jpt.jpa.core.internal.context.TableColumnTextRangeResolver; -import org.eclipse.jpt.jpa.core.internal.context.JoinColumnTextRangeResolver; -import org.eclipse.jpt.jpa.core.internal.context.JptValidator; -import org.eclipse.jpt.jpa.core.internal.context.MappingTools; -import org.eclipse.jpt.jpa.core.internal.context.OverrideTextRangeResolver; -import org.eclipse.jpt.jpa.core.internal.context.TableTextRangeResolver; -import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmBaseEmbeddedMapping; -import org.eclipse.jpt.jpa.core.internal.jpa1.context.AssociationOverrideInverseJoinColumnValidator; -import org.eclipse.jpt.jpa.core.internal.jpa1.context.AssociationOverrideJoinColumnValidator; -import org.eclipse.jpt.jpa.core.internal.jpa1.context.AssociationOverrideJoinTableValidator; -import org.eclipse.jpt.jpa.core.internal.jpa1.context.AssociationOverrideValidator; -import org.eclipse.jpt.jpa.core.internal.jpa1.context.EmbeddableOverrideDescriptionProvider; -import org.eclipse.jpt.jpa.core.internal.jpa1.context.EntityTableDescriptionProvider; -import org.eclipse.jpt.jpa.core.internal.jpa1.context.JoinTableTableDescriptionProvider; -import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmAssociationOverrideContainer2_0; -import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmEmbeddedMapping2_0; -import org.eclipse.jpt.jpa.core.resource.orm.Attributes; -import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride; import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedded; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; -import org.eclipse.wst.validation.internal.provisional.core.IReporter; /** * <code>orm.xml</code> embedded mapping */ public class GenericOrmEmbeddedMapping - extends AbstractOrmBaseEmbeddedMapping<XmlEmbedded> - implements OrmEmbeddedMapping2_0 + extends AbstractOrmEmbeddedMapping<XmlEmbedded> { - protected final OrmAssociationOverrideContainer associationOverrideContainer; - - public GenericOrmEmbeddedMapping(OrmPersistentAttribute parent, XmlEmbedded xmlMapping) { super(parent, xmlMapping); - this.associationOverrideContainer = this.buildAssociationOverrideContainer(); - } - - - // ********** synchronize/update ********** - - @Override - public void synchronizeWithResourceModel() { - super.synchronizeWithResourceModel(); - this.associationOverrideContainer.synchronizeWithResourceModel(); - } - - @Override - public void update() { - super.update(); - this.associationOverrideContainer.update(); - } - - - // ********** association override container ********** - - public OrmAssociationOverrideContainer getAssociationOverrideContainer() { - return this.associationOverrideContainer; - } - - protected OrmAssociationOverrideContainer buildAssociationOverrideContainer() { - return this.isOrmXml2_0Compatible() ? - this.getContextNodeFactory2_0().buildOrmAssociationOverrideContainer(this, this.buildAssociationOverrideContainerOwner()) : - new GenericOrmAssociationOverrideContainer(this, null); - } - - protected OrmAssociationOverrideContainer2_0.Owner buildAssociationOverrideContainerOwner() { - return new AssociationOverrideContainerOwner(); - } - - - // ********** embedded mappings ********** - - /** - * This is only to build the choices for a "mapped by" setting in a - * relationship mapping. JPA 2.0 does not support relationship mappings - * in an embedded ID class; so we only put this logic here. - */ - @Override - @SuppressWarnings("unchecked") - public Iterable<String> getAllMappingNames() { - return this.isJpa2_0Compatible() ? - new CompositeIterable<String>(super.getAllMappingNames(), this.getAllEmbeddableAttributeMappingNames()) : - super.getAllMappingNames(); - } - - protected Iterable<String> getAllEmbeddableAttributeMappingNames() { - return this.getQualifiedEmbeddableOverridableMappingNames(AttributeMappingTools.ALL_MAPPING_NAMES_TRANSFORMER); - } - - protected Iterable<RelationshipMapping> allOverridableAssociations() { - return (this.targetEmbeddable != null) ? - new SubIterableWrapper<AttributeMapping, RelationshipMapping>(this.getAllOverridableAssociations_()) : - EmptyIterable.<RelationshipMapping>instance(); - } - - protected Iterable<AttributeMapping> getAllOverridableAssociations_() { - return new FilteringIterable<AttributeMapping>(this.targetEmbeddable.getAttributeMappings()) { - @Override - protected boolean accept(AttributeMapping attributeMapping) { - return attributeMapping.isOverridableAssociationMapping(); - } - }; - } - - @Override - public AttributeMapping resolveAttributeMapping(String attributeName) { - AttributeMapping resolvedMapping = super.resolveAttributeMapping(attributeName); - if (resolvedMapping != null) { - return resolvedMapping; - } - return this.isJpa2_0Compatible() ? this.resolveAttributeMapping_(attributeName) : null; - } - - protected AttributeMapping resolveAttributeMapping_(String attributeName) { - attributeName = this.unqualify(attributeName); - if (attributeName == null) { - return null; - } - // recurse into the embeddable mappings - for (AttributeMapping mapping : this.getEmbeddableAttributeMappings()) { - AttributeMapping resolvedMapping = mapping.resolveAttributeMapping(attributeName); - if (resolvedMapping != null) { - return resolvedMapping; - } - } - return null; - } - - - // ********** misc ********** - - public String getKey() { - return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY; - } - - public int getXmlSequence() { - return 80; - } - - public void initializeOn(OrmAttributeMapping newMapping) { - newMapping.initializeFromOrmEmbeddedMapping(this); - } - - public void addXmlAttributeMappingTo(Attributes xmlAttributes) { - xmlAttributes.getEmbeddeds().add(this.xmlAttributeMapping); - } - - public void removeXmlAttributeMappingFrom(Attributes xmlAttributes) { - xmlAttributes.getEmbeddeds().remove(this.xmlAttributeMapping); - } - - @Override - public Relationship resolveOverriddenRelationship(String attributeName) { - return this.isJpa2_0Compatible() ? this.resolveOverriddenRelationship_(attributeName) : null; - } - - protected Relationship resolveOverriddenRelationship_(String attributeName) { - attributeName = this.unqualify(attributeName); - if (attributeName == null) { - return null; - } - AssociationOverride override = this.associationOverrideContainer.getSpecifiedOverrideNamed(attributeName); - // recurse into the target embeddable if necessary - return (override != null) ? override.getRelationship() : this.resolveOverriddenRelationshipInTargetEmbeddable(attributeName); - } - - protected Relationship resolveOverriddenRelationshipInTargetEmbeddable(String attributeName) { - return (this.targetEmbeddable == null) ? null : this.targetEmbeddable.resolveOverriddenRelationship(attributeName); - } - - @Override - protected OrmAttributeOverrideContainer.Owner buildAttributeOverrideContainerOwner() { - return new AttributeOverrideContainerOwner(); - } - - - // ********** validation ********** - - @Override - protected void validateOverrides(List<IMessage> messages, IReporter reporter) { - super.validateOverrides(messages, reporter); - this.associationOverrideContainer.validate(messages, reporter); - } - - - // ********** attribute override container owner ********* - - protected class AttributeOverrideContainerOwner - extends AbstractOrmBaseEmbeddedMapping<XmlEmbedded>.AttributeOverrideContainerOwner - { - // nothing yet - } - - - // ********** association override container owner ********** - - protected class AssociationOverrideContainerOwner - implements OrmAssociationOverrideContainer2_0.Owner - { - protected String getMappingName() { - return GenericOrmEmbeddedMapping.this.getName(); - } - - public OrmTypeMapping getTypeMapping() { - return GenericOrmEmbeddedMapping.this.getTypeMapping(); - } - - public TypeMapping getOverridableTypeMapping() { - return GenericOrmEmbeddedMapping.this.getTargetEmbeddable(); - } - - public Iterable<String> getAllOverridableNames() { - TypeMapping typeMapping = this.getOverridableTypeMapping(); - return (typeMapping != null) ? typeMapping.getAllOverridableAssociationNames() : EmptyIterable.<String>instance(); - } - - public Iterable<String> getJavaOverrideNames() { - return null; - } - - public EList<XmlAssociationOverride> getXmlOverrides() { - return GenericOrmEmbeddedMapping.this.getXmlAttributeMapping().getAssociationOverrides(); - } - - public Relationship resolveOverriddenRelationship(String attributeName) { - return MappingTools.resolveOverriddenRelationship(this.getOverridableTypeMapping(), attributeName); - } - - public boolean tableNameIsInvalid(String tableName) { - return this.getTypeMapping().tableNameIsInvalid(tableName); - } - - public Iterable<String> getCandidateTableNames() { - return this.getTypeMapping().getAllAssociatedTableNames(); - } - - public org.eclipse.jpt.jpa.db.Table resolveDbTable(String tableName) { - return this.getTypeMapping().resolveDbTable(tableName); - } - - public String getDefaultTableName() { - return this.getTypeMapping().getPrimaryTableName(); - } - - public TextRange getValidationTextRange() { - return GenericOrmEmbeddedMapping.this.getValidationTextRange(); - } - - public JptValidator buildOverrideValidator(ReadOnlyOverride override, OverrideContainer container, OverrideTextRangeResolver textRangeResolver) { - return new AssociationOverrideValidator(this.getPersistentAttribute(), (ReadOnlyAssociationOverride) override, (AssociationOverrideContainer) container, textRangeResolver, new EmbeddableOverrideDescriptionProvider()); - } - - public JptValidator buildColumnValidator(ReadOnlyOverride override, ReadOnlyBaseColumn column, ReadOnlyBaseColumn.Owner owner, TableColumnTextRangeResolver textRangeResolver) { - return new AssociationOverrideJoinColumnValidator(this.getPersistentAttribute(), (ReadOnlyAssociationOverride) override, (ReadOnlyJoinColumn) column, (ReadOnlyJoinColumn.Owner) owner, (JoinColumnTextRangeResolver) textRangeResolver, new EntityTableDescriptionProvider()); - } - - public JptValidator buildJoinTableJoinColumnValidator(ReadOnlyAssociationOverride override, ReadOnlyJoinColumn column, ReadOnlyJoinColumn.Owner owner, JoinColumnTextRangeResolver textRangeResolver) { - return new AssociationOverrideJoinColumnValidator(this.getPersistentAttribute(), override, column, owner, textRangeResolver, new JoinTableTableDescriptionProvider()); - } - - public JptValidator buildJoinTableInverseJoinColumnValidator(ReadOnlyAssociationOverride override, ReadOnlyJoinColumn column, ReadOnlyJoinColumn.Owner owner, JoinColumnTextRangeResolver textRangeResolver) { - return new AssociationOverrideInverseJoinColumnValidator(this.getPersistentAttribute(), override, column, owner, textRangeResolver, new JoinTableTableDescriptionProvider()); - } - - public JptValidator buildJoinTableValidator(ReadOnlyAssociationOverride override, ReadOnlyTable table, TableTextRangeResolver textRangeResolver) { - return new AssociationOverrideJoinTableValidator(this.getPersistentAttribute(), override, (ReadOnlyJoinTable) table, textRangeResolver); - } - - protected OrmPersistentAttribute getPersistentAttribute() { - return GenericOrmEmbeddedMapping.this.getPersistentAttribute(); - } } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/AbstractJavaElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/AbstractJavaElementCollectionMapping2_0.java index 9e9a74fb1d..1a1ea88cf8 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/AbstractJavaElementCollectionMapping2_0.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/java/AbstractJavaElementCollectionMapping2_0.java @@ -12,7 +12,6 @@ package org.eclipse.jpt.jpa.core.internal.jpa2.context.java; import java.util.ArrayList; import java.util.List; import org.eclipse.jdt.core.dom.CompilationUnit; -import org.eclipse.jpt.common.core.internal.utility.JDTTools; import org.eclipse.jpt.common.core.resource.java.Annotation; import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute; import org.eclipse.jpt.common.core.resource.java.JavaResourceMember; @@ -1474,6 +1473,7 @@ public abstract class AbstractJavaElementCollectionMapping2_0 @Override public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { super.validate(messages, reporter, astRoot); + this.validateAttributeType(messages, reporter, astRoot); this.validateTargetClass(messages, astRoot); this.validateMapKeyClass(messages, astRoot); this.orderable.validate(messages, reporter, astRoot); @@ -1607,6 +1607,34 @@ public abstract class AbstractJavaElementCollectionMapping2_0 } } + protected void validateAttributeType(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { + JavaPersistentAttribute javaAttribute = this.getJavaPersistentAttribute(); + if ((javaAttribute != null) && !javaAttribute.getJpaContainerDefinition().isContainer()) { + if (this.getPersistentAttribute().isVirtual()) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE, + new String[] {this.getName()}, + this, + this.getValidationTextRange(astRoot) + ) + ); + } + else { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE, + EMPTY_STRING_ARRAY, + this, + this.getValidationTextRange(astRoot) + ) + ); + } + } + } + protected void validateTargetClass(List<IMessage> messages, CompilationUnit astRoot) { String targetClass = this.getFullyQualifiedTargetClass(); if (targetClass == null) { @@ -1634,7 +1662,7 @@ public abstract class AbstractJavaElementCollectionMapping2_0 return; } - if (JDTTools.typeIsBasic(this.getJavaProject(), targetClass)) { + if (MappingTools.typeIsBasic(this.getJavaProject(), targetClass)) { return; } if (this.getResolvedTargetEmbeddable() == null) { @@ -1701,6 +1729,34 @@ public abstract class AbstractJavaElementCollectionMapping2_0 ); } } + + if (MappingTools.typeIsBasic(this.getJavaProject(), this.getFullyQualifiedMapKeyClass())) { + return; + } + + if (this.getResolvedMapKeyEmbeddable() == null && this.getResolvedMapKeyEntity() == null) { + if (this.getPersistentAttribute().isVirtual()) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE, + new String[] {this.getName(), this.getFullyQualifiedMapKeyClass()}, + this, + this.getTargetClassTextRange(astRoot) + ) + ); + } else { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE, + new String[] {this.getFullyQualifiedMapKeyClass()}, + this, + this.getTargetClassTextRange(astRoot) + ) + ); + } + } } protected void validateValue(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) { diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java index 2747edbaf2..b498afe0e0 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa2/context/orm/AbstractOrmElementCollectionMapping2_0.java @@ -1464,6 +1464,7 @@ public abstract class AbstractOrmElementCollectionMapping2_0<X extends XmlElemen @Override public void validate(List<IMessage> messages, IReporter reporter) { super.validate(messages, reporter); + this.validateAttributeType(messages, reporter); this.validateTargetClass(messages); this.validateMapKeyClass(messages); this.orderable.validate(messages, reporter); @@ -1473,6 +1474,25 @@ public abstract class AbstractOrmElementCollectionMapping2_0<X extends XmlElemen this.validateNoEmbeddableInMappingContainsProhibitedMapping(messages); } + protected void validateAttributeType(List<IMessage> messages, IReporter reporter) { + JavaPersistentAttribute javaAttribute = this.getJavaPersistentAttribute(); + if ((javaAttribute != null) && !javaAttribute.getJpaContainerDefinition().isContainer()) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE, + new String[] {this.getFullyQualifiedAttributeType()}, + this, + this.getAttributeTypeTextRange() + ) + ); + } + } + + protected TextRange getAttributeTypeTextRange() { + return this.getValidationTextRange(); + } + protected void validateNoEmbeddableInMappingContainsProhibitedMapping(List<IMessage> messages) { Embeddable embeddableClass = getResolvedTargetEmbeddable(); if (embeddableClass != null) { @@ -1585,22 +1605,24 @@ public abstract class AbstractOrmElementCollectionMapping2_0<X extends XmlElemen ); return; } - if (JDTTools.typeIsBasic(this.getJavaProject(), this.getFullyQualifiedTargetClass())) { + if (MappingTools.typeIsBasic(this.getJavaProject(), this.getFullyQualifiedTargetClass())) { return; } - IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedTargetClass()); //If a persistent type exists, but no underlying java class, then //you will get validation on that persistent type instead of here - if (jdtType == null && this.getResolvedTargetType() == null) { - messages.add( - DefaultJpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - JpaValidationMessages.ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST, - new String[] {this.getFullyQualifiedTargetClass()}, - this, - this.getTargetClassTextRange() - ) - ); + if (this.getResolvedTargetType() == null) { + IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedTargetClass()); + if (jdtType == null) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST, + new String[] {this.getFullyQualifiedTargetClass()}, + this, + this.getTargetClassTextRange() + ) + ); + } return; } if (this.getResolvedTargetEmbeddable() == null) { @@ -1634,24 +1656,41 @@ public abstract class AbstractOrmElementCollectionMapping2_0<X extends XmlElemen JpaValidationMessages.MAP_KEY_CLASS_NOT_DEFINED, EMPTY_STRING_ARRAY, this, - this.getValidationTextRange() + this.getMapKeyClassTextRange() ) ); return; } - IType mapKeyJdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedMapKeyClass()); - if (mapKeyJdtType == null) { + if (MappingTools.typeIsBasic(this.getJavaProject(), this.getFullyQualifiedMapKeyClass())) { + return; + } + + if (this.getResolvedMapKeyType() == null) { + IType mapKeyJdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedMapKeyClass()); + if (mapKeyJdtType == null) { + messages.add( + DefaultJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + JpaValidationMessages.MAP_KEY_CLASS_NOT_EXIST, + new String[] {this.getFullyQualifiedMapKeyClass()}, + this, + this.getMapKeyClassTextRange() + ) + ); + } + return; + } + if (this.getResolvedMapKeyEmbeddable() == null && this.getResolvedMapKeyEntity() == null) { messages.add( DefaultJpaValidationMessages.buildMessage( IMessage.HIGH_SEVERITY, - JpaValidationMessages.MAP_KEY_CLASS_NOT_EXIST, + JpaValidationMessages.MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE, new String[] {this.getFullyQualifiedMapKeyClass()}, this, this.getMapKeyClassTextRange() ) ); - return; } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/validation/JpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/validation/JpaValidationMessages.java index a85279d136..9bb97ed9e0 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/validation/JpaValidationMessages.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/validation/JpaValidationMessages.java @@ -93,6 +93,7 @@ public interface JpaValidationMessages { //Attribute public static final String MAP_KEY_CLASS_NOT_DEFINED = "MAP_KEY_CLASS_NOT_DEFINED"; public static final String MAP_KEY_CLASS_NOT_EXIST = "MAP_KEY_CLASS_NOT_EXIST"; + public static final String MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE = "MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE"; public static final String ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST = "ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST"; public static final String ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_ELEMENT_COLLECTION_MAPPING = "ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_ELEMENT_COLLECTION_MAPPING"; public static final String ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_PROHIBITED_RELATIONSHIP_MAPPING = "ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_PROHIBITED_RELATIONSHIP_MAPPING"; @@ -127,9 +128,11 @@ public interface JpaValidationMessages { public static final String TARGET_ENTITY_IS_NOT_AN_ENTITY = "TARGET_ENTITY_IS_NOT_AN_ENTITY"; public static final String TARGET_ENTITY_NOT_DEFINED = "TARGET_ENTITY_NOT_DEFINED"; public static final String TARGET_ENTITY_NOT_EXIST = "TARGET_ENTITY_NOT_EXIST"; - + public static final String ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE = "ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE"; + //***Implied Attribute*** public static final String VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_NOT_DEFINED = "VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_NOT_DEFINED"; + public static final String VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE = "VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE"; public static final String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST = "VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST"; public static final String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_ELEMENT_COLLECTION_MAPPING = "VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_ELEMENT_COLLECTION_MAPPING"; public static final String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_PROHIBITED_RELATIONSHIP_MAPPING = "VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_PROHIBITED_RELATIONSHIP_MAPPING"; @@ -140,6 +143,8 @@ public interface JpaValidationMessages { public static final String VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE = "VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE"; public static final String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE = "VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE"; public static final String VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE = "VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE"; + public static final String VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE = "VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE"; + public static final String VIRTUAL_ATTRIBUTE_TARGET_NOT_AN_EMBEDDABLE = "VIRTUAL_ATTRIBUTE_TARGET_NOT_AN_EMBEDDABLE"; public static final String VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR = "VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR"; public static final String VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_EQUALS_HASHCODE = "VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_EQUALS_HASHCODE"; public static final String VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS = "VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS"; diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipseLinkResourceModels.genmodel b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipseLinkResourceModels.genmodel index c5679968cb..8db5a45ab3 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipseLinkResourceModels.genmodel +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipseLinkResourceModels.genmodel @@ -64,7 +64,7 @@ <genClasses ecoreClass="eclipselink_orm.ecore#//XmlAdditionalCriteria"/> <genClasses ecoreClass="eclipselink_orm.ecore#//XmlArray"/> <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlAttributeMapping"> - <genOperations ecoreOperation="eclipselink_orm.ecore#//XmlAttributeMapping/getTypeName"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlAttributeMapping/attributeType"/> </genClasses> <genClasses ecoreClass="eclipselink_orm.ecore#//Attributes"> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//Attributes/basicCollections"/> @@ -343,21 +343,12 @@ <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlBasic_2_1"> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlBasic_2_1/returnInsert"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlBasic_2_1/returnUpdate"/> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlBasic_2_1/attributeType"/> </genClasses> <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlBatchFetch_2_1"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlBatchFetch_2_1/size"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlBatchFetch_2_1/batchFetchType"/> </genClasses> - <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlElementCollection_2_1"> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlElementCollection_2_1/attributeType"/> - </genClasses> - <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlEmbedded_2_1"> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlEmbedded_2_1/attributeType"/> - </genClasses> - <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlEmbeddedId_2_1"> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlEmbeddedId_2_1/attributeType"/> - </genClasses> + <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlElementCollection_2_1"/> <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlEntity_2_1"> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlEntity_2_1/classExtractor"/> </genClasses> @@ -373,20 +364,13 @@ <genClasses ecoreClass="eclipselink_orm.ecore#//v2_1/XmlFetchGroupContainer_2_1"> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlFetchGroupContainer_2_1/fetchGroups"/> </genClasses> - <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlId_2_1"> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlId_2_1/attributeType"/> - </genClasses> - <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlManyToMany_2_1"> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlManyToMany_2_1/attributeType"/> - </genClasses> + <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlManyToMany_2_1"/> <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlManyToOne_2_1"/> <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlMappedSuperclass_2_1"> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlMappedSuperclass_2_1/sqlResultSetMappings"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlMappedSuperclass_2_1/queryRedirectors"/> </genClasses> - <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlOneToMany_2_1"> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlOneToMany_2_1/attributeType"/> - </genClasses> + <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlOneToMany_2_1"/> <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlOneToOne_2_1"/> <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlPersistenceUnitDefaults_2_1"/> <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlPrimaryKey_2_1"> @@ -395,15 +379,9 @@ <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlReturnInsert_2_1"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlReturnInsert_2_1/returnOnly"/> </genClasses> - <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlTransformation_2_1"> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlTransformation_2_1/attributeType"/> - </genClasses> <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlTypeMapping_2_1"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlTypeMapping_2_1/parentClass"/> </genClasses> - <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlVersion_2_1"> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlVersion_2_1/attributeType"/> - </genClasses> </nestedGenPackages> <nestedGenPackages prefix="EclipseLinkOrmV2_2" basePackage="org.eclipse.jpt.jpa.eclipselink.core.resource.orm" disposableProviderFactory="true" adapterFactory="false" fileExtensions="EclipseLinkOrmV2_2" @@ -545,7 +523,6 @@ <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlArray_2_3"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlArray_2_3/databaseType"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlArray_2_3/targetClass"/> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlArray_2_3/attributeType"/> </genClasses> <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlAttributes_2_3"> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlAttributes_2_3/structures"/> @@ -612,9 +589,7 @@ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlTenantDiscriminatorColumn_2_3/table"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlTenantDiscriminatorColumn_2_3/primaryKey"/> </genClasses> - <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlStructure_2_3"> - <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlStructure_2_3/attributeType"/> - </genClasses> + <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlStructure_2_3"/> </nestedGenPackages> <nestedGenPackages prefix="EclipseLinkOrmV2_4" basePackage="org.eclipse.jpt.jpa.eclipselink.core.resource.orm" disposableProviderFactory="true" adapterFactory="false" fileExtensions="EclipselinkOrmV2_4" diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipselink_orm.ecore b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipselink_orm.ecore index f4d5662652..f9bd98e0b9 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipselink_orm.ecore +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipselink_orm.ecore @@ -16,7 +16,7 @@ <eClassifiers xsi:type="ecore:EClass" name="XmlArray" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping #//v2_3/XmlArray_2_3 #//XmlConvertibleMapping"/> <eClassifiers xsi:type="ecore:EClass" name="XmlAttributeMapping" abstract="true" interface="true" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlAttributeMapping #//XmlAccessMethodsHolder #//XmlPropertyContainer"> - <eOperations name="getTypeName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="Attributes" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//Attributes #//v2_3/XmlAttributes_2_3"> <eStructuralFeatures xsi:type="ecore:EReference" name="basicCollections" upperBound="-1" @@ -114,8 +114,8 @@ <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaultMappings" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/> </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="XmlEmbedded" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlEmbedded #//v2_1/XmlEmbedded_2_1 #//XmlAttributeMapping"/> - <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddedId" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlEmbeddedId #//v2_1/XmlEmbeddedId_2_1 #//XmlAttributeMapping"/> + <eClassifiers xsi:type="ecore:EClass" name="XmlEmbedded" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlEmbedded #//XmlAttributeMapping"/> + <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddedId" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlEmbeddedId #//XmlAttributeMapping"/> <eClassifiers xsi:type="ecore:EClass" name="XmlEntity" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlEntity #//XmlTypeMapping #//v1_1/XmlEntity_1_1 #//v2_0/XmlEntity_2_0 #//v2_1/XmlEntity_2_1 #//v2_2/XmlEntity_2_2 #//v2_3/XmlEntity_2_3 #//v2_4/XmlEntity_2_4 #//XmlReadOnly #//XmlCustomizerHolder #//XmlChangeTrackingHolder #//XmlCacheHolder #//XmlConverterContainer #//XmlQueryContainer #//XmlPropertyContainer"> <eStructuralFeatures xsi:type="ecore:EReference" name="optimisticLocking" eType="#//XmlOptimisticLocking" containment="true" resolveProxies="false"/> @@ -132,7 +132,7 @@ <eClassifiers xsi:type="ecore:EClass" name="XmlFetchAttribute" eSuperTypes="#//v2_1/XmlFetchAttribute_2_1"/> <eClassifiers xsi:type="ecore:EClass" name="XmlFetchGroup" eSuperTypes="#//v2_1/XmlFetchGroup_2_1"/> <eClassifiers xsi:type="ecore:EClass" name="XmlHashPartitioning" eSuperTypes="#//v2_2/XmlHashPartitioning_2_2"/> - <eClassifiers xsi:type="ecore:EClass" name="XmlId" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlId #//v2_1/XmlId_2_1 #//v2_2/XmlId_2_2 #//v2_4/XmlId_2_4 #//XmlAttributeMapping #//XmlMutable #//XmlConvertibleMapping #//XmlConverterContainer"/> + <eClassifiers xsi:type="ecore:EClass" name="XmlId" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlId #//v2_2/XmlId_2_2 #//v2_4/XmlId_2_4 #//XmlAttributeMapping #//XmlMutable #//XmlConvertibleMapping #//XmlConverterContainer"/> <eClassifiers xsi:type="ecore:EClass" name="XmlIndex" eSuperTypes="#//v2_2/XmlIndex_2_2"/> <eClassifiers xsi:type="ecore:EClass" name="XmlInstantiationCopyPolicy"/> <eClassifiers xsi:type="ecore:EClass" name="XmlJoinFetch" abstract="true" interface="true"> @@ -256,7 +256,7 @@ <eStructuralFeatures xsi:type="ecore:EAttribute" name="second" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="millisecond" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/> </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="XmlTransformation" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlAttributeMapping #//v2_1/XmlTransformation_2_1 #//XmlAttributeMapping"/> + <eClassifiers xsi:type="ecore:EClass" name="XmlTransformation" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping"/> <eClassifiers xsi:type="ecore:EClass" name="XmlTransient" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlTransient #//XmlAttributeMapping"/> <eClassifiers xsi:type="ecore:EClass" name="XmlTypeConverter" eSuperTypes="#//XmlNamedConverter"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="dataType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> @@ -269,7 +269,7 @@ <eClassifiers xsi:type="ecore:EClass" name="XmlVariableOneToOne" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping #//v2_2/XmlVariableOneToOne_2_2"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="targetInterface" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="XmlVersion" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlVersion #//v2_1/XmlVersion_2_1 #//v2_2/XmlVersion_2_2 #//XmlAttributeMapping #//XmlMutable #//XmlConvertibleMapping #//XmlConverterContainer"/> + <eClassifiers xsi:type="ecore:EClass" name="XmlVersion" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlVersion #//v2_2/XmlVersion_2_2 #//XmlAttributeMapping #//XmlMutable #//XmlConvertibleMapping #//XmlConverterContainer"/> <eClassifiers xsi:type="ecore:EEnum" name="CacheCoordinationType"> <eLiterals name="SEND_OBJECT_CHANGES"/> <eLiterals name="INVALIDATE_CHANGED_OBJECTS" value="1"/> @@ -394,7 +394,6 @@ <eStructuralFeatures xsi:type="ecore:EReference" name="returnInsert" eType="#//XmlReturnInsert" containment="true" resolveProxies="false"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="returnUpdate" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="XmlBatchFetch_2_1" abstract="true" interface="true"> @@ -402,16 +401,7 @@ <eStructuralFeatures xsi:type="ecore:EAttribute" name="batchFetchType" eType="#//v2_1/BatchFetchType_2_1"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection_2_1" abstract="true" - interface="true" eSuperTypes="#//XmlJoinFetch #//XmlBatchFetchHolder"> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> - </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="XmlEmbedded_2_1" abstract="true" interface="true"> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> - </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddedId_2_1" abstract="true" - interface="true"> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> - </eClassifiers> + interface="true" eSuperTypes="#//XmlJoinFetch #//XmlBatchFetchHolder"/> <eClassifiers xsi:type="ecore:EClass" name="XmlEntity_2_1" abstract="true" interface="true" eSuperTypes="#//v2_1/XmlTypeMapping_2_1 #//v2_1/XmlFetchGroupContainer_2_1"> <eStructuralFeatures xsi:type="ecore:EReference" name="classExtractor" eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlClassReference" @@ -435,13 +425,8 @@ <eStructuralFeatures xsi:type="ecore:EReference" name="fetchGroups" upperBound="-1" eType="#//XmlFetchGroup" containment="true" resolveProxies="false"/> </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="XmlId_2_1" abstract="true" interface="true"> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> - </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="XmlManyToMany_2_1" abstract="true" - interface="true" eSuperTypes="#//XmlBatchFetchHolder"> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> - </eClassifiers> + interface="true" eSuperTypes="#//XmlBatchFetchHolder"/> <eClassifiers xsi:type="ecore:EClass" name="XmlManyToOne_2_1" abstract="true" interface="true" eSuperTypes="#//XmlBatchFetchHolder"/> <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass_2_1" abstract="true" @@ -453,9 +438,7 @@ containment="true" resolveProxies="false"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany_2_1" abstract="true" - interface="true" eSuperTypes="#//XmlBatchFetchHolder"> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> - </eClassifiers> + interface="true" eSuperTypes="#//XmlBatchFetchHolder"/> <eClassifiers xsi:type="ecore:EClass" name="XmlOneToOne_2_1" abstract="true" interface="true" eSuperTypes="#//XmlBatchFetchHolder"/> <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitDefaults_2_1" abstract="true" @@ -468,17 +451,10 @@ interface="true"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="returnOnly" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/> </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="XmlTransformation_2_1" abstract="true" - interface="true"> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> - </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="XmlTypeMapping_2_1" abstract="true" interface="true" eSuperTypes="#//XmlAccessMethodsHolder"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="parentClass" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="XmlVersion_2_1" abstract="true" interface="true"> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> - </eClassifiers> <eClassifiers xsi:type="ecore:EEnum" name="CacheKeyType_2_1"> <eLiterals name="ID_VALUE" literal="ID_VALUE"/> <eLiterals name="CACHE_KEY" value="1"/> @@ -671,7 +647,6 @@ eSuperTypes="#//XmlConverterContainer ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlConvertibleMapping ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//ColumnMapping"> <eStructuralFeatures xsi:type="ecore:EAttribute" name="databaseType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="targetClass" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="XmlAttributes_2_3" abstract="true" interface="true"> @@ -777,9 +752,7 @@ <eStructuralFeatures xsi:type="ecore:EAttribute" name="primaryKey" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="XmlStructure_2_3" abstract="true" - interface="true"> - <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/> - </eClassifiers> + interface="true"/> <eClassifiers xsi:type="ecore:EEnum" name="MultitenantType"> <eLiterals name="SINGLE_TABLE"/> <eLiterals name="TABLE_PER_TENANT" value="1" literal="TABLE_PER_TENANT"/> diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/property_files/eclipselink_jpa_validation.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/property_files/eclipselink_jpa_validation.properties index 1ebd983b4b..2c3726b4a9 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/property_files/eclipselink_jpa_validation.properties +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/property_files/eclipselink_jpa_validation.properties @@ -60,4 +60,5 @@ MULTITENANT_TABLE_PER_TENANT_NOT_SUPPORTED=EclipseLink does not support Multiten MULTITENANT_VPD_MIGHT_NOT_BE_NOT_SUPPORTED=Target database is not specified in the persistence.xml, multitenancy with Oracle VPD might not be supported MULTITENANT_VPD_NOT_SUPPORTED_ON_NON_ORACLE_DATABASE_PLATFORM=Target database is \"{0}\", multitenancy with Oracle VPD is only supported on Oracle platform MULTITENANT_VPD_INCLUDE_CRITERIA_WILL_BE_IGNORED=Include criteria is false when multitenant type is VPD. The specified setting will be ignored. -VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED=Virtual attribute \"{0}\" must specify an attribute-type. Note: For a one-to-one or a many-to-one, the attribute-type is specified using target-entity. For a variable-one-to-one it is specified using target-interface.
\ No newline at end of file +VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED=Virtual attribute \"{0}\" must specify an attribute-type +VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST=Attribute type \"{0}\" does not exist
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaValidationMessages.java index d989878a5a..e9ea2dbc66 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaValidationMessages.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaValidationMessages.java @@ -108,4 +108,5 @@ public interface EclipseLinkJpaValidationMessages { public static final String MULTITENANT_VPD_INCLUDE_CRITERIA_WILL_BE_IGNORED = "MULTITENANT_VPD_INCLUDE_CRITERIA_WILL_BE_IGNORED"; public static final String VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED = "VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED"; + public static final String VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST = "VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST"; } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmElementCollectionMapping2_0.java index 1768d5bf57..7e95f9eac9 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmElementCollectionMapping2_0.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmElementCollectionMapping2_0.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2011 Oracle. All rights reserved. + * Copyright (c) 2010, 2012 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. @@ -12,15 +12,21 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm; import java.util.List; import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.IType; +import org.eclipse.jpt.common.core.internal.utility.JDTTools; +import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.common.utility.internal.StringTools; import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; import org.eclipse.jpt.jpa.core.context.orm.OrmConverter; import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.AbstractOrmElementCollectionMapping2_0; import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin; +import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkElementCollectionMapping2_0; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch; import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer; +import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages; +import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection; import org.eclipse.text.edits.ReplaceEdit; import org.eclipse.wst.validation.internal.provisional.core.IMessage; @@ -62,6 +68,19 @@ public class EclipseLinkOrmElementCollectionMapping2_0 } + // ********** attribute type ********** + + @Override + protected String buildSpecifiedAttributeType() { + return this.xmlAttributeMapping.getAttributeType(); + } + + @Override + protected void setSpecifiedAttributeTypeInXml(String attributeType) { + this.xmlAttributeMapping.setAttributeType(attributeType); + } + + // ********** join fetch ********** public EclipseLinkJoinFetch getJoinFetch() { @@ -125,4 +144,48 @@ public class EclipseLinkOrmElementCollectionMapping2_0 super.validate(messages, reporter); // TODO join fetch validation } + + @Override + protected void validateAttributeType(List<IMessage> messages, IReporter reporter) { + if (this.isVirtualAccess()) { + if (StringTools.stringIsEmpty(this.getAttributeType())) { + messages.add( + DefaultEclipseLinkJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED, + new String[] {this.getName()}, + this, + this.getAttributeTypeTextRange() + ) + ); + return; + } + if (this.getResolvedAttributeType() == null) { + IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedAttributeType()); + if (jdtType == null) { + messages.add( + DefaultEclipseLinkJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST, + new String[] {this.getFullyQualifiedAttributeType()}, + this, + this.getAttributeTypeTextRange() + ) + ); + return; + } + } + } + super.validateAttributeType(messages, reporter); + } + + + protected boolean isVirtualAccess() { + return getPersistentAttribute().getAccess() == EclipseLinkAccessType.VIRTUAL; + } + + @Override + protected TextRange getAttributeTypeTextRange() { + return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange()); + } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java index 4cff7e95ea..e29f58d860 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java @@ -12,6 +12,8 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm; import org.eclipse.jpt.jpa.core.context.orm.EntityMappings; import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping; import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable; +import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedIdMapping; +import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedMapping; import org.eclipse.jpt.jpa.core.context.orm.OrmEntity; import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping; import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping; @@ -31,6 +33,8 @@ import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable; +import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded; +import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId; @@ -89,6 +93,16 @@ public class EclipseLinkOrmXmlContextNodeFactory public OrmIdMapping buildOrmIdMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlId resourceMapping) { return new OrmEclipseLinkIdMapping(parent, (XmlId) resourceMapping); } + + @Override + public OrmEmbeddedMapping buildOrmEmbeddedMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedded resourceMapping) { + return new OrmEclipseLinkEmbeddedMapping(parent, (XmlEmbedded) resourceMapping); + } + + @Override + public OrmEmbeddedIdMapping buildOrmEmbeddedIdMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddedId resourceMapping) { + return new OrmEclipseLinkEmbeddedIdMapping(parent, (XmlEmbeddedId) resourceMapping); + } @Override public OrmManyToManyMapping buildOrmManyToManyMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany resourceMapping) { diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkArrayMapping2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkArrayMapping2_3.java index 84bc3676fb..0dfe4c6c23 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkArrayMapping2_3.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkArrayMapping2_3.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Oracle. All rights reserved. + * Copyright (c) 2011, 2012 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. @@ -97,6 +97,19 @@ public class OrmEclipseLinkArrayMapping2_3 } + // ********** attribute type ********** + + @Override + protected String buildSpecifiedAttributeType() { + return this.xmlAttributeMapping.getAttributeType(); + } + + @Override + protected void setSpecifiedAttributeTypeInXml(String attributeType) { + this.xmlAttributeMapping.setAttributeType(attributeType); + } + + // ********** column ********** public OrmColumn getColumn() { diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java index 1672148aaa..c95c48e496 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -12,14 +12,21 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm; import java.util.List; import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.IType; +import org.eclipse.jpt.common.core.internal.utility.JDTTools; +import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.common.utility.internal.StringTools; import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; import org.eclipse.jpt.jpa.core.context.orm.OrmConverter; import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute; +import org.eclipse.jpt.jpa.core.internal.context.MappingTools; import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmBasicMapping; +import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable; import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer; +import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages; +import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic; import org.eclipse.text.edits.ReplaceEdit; import org.eclipse.wst.validation.internal.provisional.core.IMessage; @@ -61,6 +68,19 @@ public class OrmEclipseLinkBasicMapping } + // ********** attribute type ********** + + @Override + protected String buildSpecifiedAttributeType() { + return this.xmlAttributeMapping.getAttributeType(); + } + + @Override + protected void setSpecifiedAttributeTypeInXml(String attributeType) { + this.xmlAttributeMapping.setAttributeType(attributeType); + } + + // ********** mutable ********** public EclipseLinkMutable getMutable() { @@ -120,6 +140,50 @@ public class OrmEclipseLinkBasicMapping @Override public void validate(List<IMessage> messages, IReporter reporter) { super.validate(messages, reporter); + this.validateAttributeType(messages); // TODO mutable validation } + + protected void validateAttributeType(List<IMessage> messages) { + if (this.isVirtualAccess()) { + if (StringTools.stringIsEmpty(this.getAttributeType())) { + messages.add( + DefaultEclipseLinkJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED, + new String[] {this.getName()}, + this, + this.getAttributeTypeTextRange() + ) + ); + return; + } + if (MappingTools.typeIsBasic(this.getJavaProject(), this.getFullyQualifiedAttributeType())) { + return; + } + if (this.getResolvedAttributeType() == null) { + IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedAttributeType()); + if (jdtType == null) { + messages.add( + DefaultEclipseLinkJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST, + new String[] {this.getFullyQualifiedAttributeType()}, + this, + this.getAttributeTypeTextRange() + ) + ); + } + return; + } + } + } + + protected boolean isVirtualAccess() { + return getPersistentAttribute().getAccess() == EclipseLinkAccessType.VIRTUAL; + } + + protected TextRange getAttributeTypeTextRange() { + return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange()); + } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddedIdMapping.java new file mode 100644 index 0000000000..3d9643aa97 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddedIdMapping.java @@ -0,0 +1,93 @@ +/******************************************************************************* + * Copyright (c) 2012 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.jpa.eclipselink.core.internal.context.orm; + +import java.util.List; +import org.eclipse.jdt.core.IType; +import org.eclipse.jpt.common.core.internal.utility.JDTTools; +import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.common.utility.internal.StringTools; +import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute; +import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.AbstractOrmEmbeddedIdMapping; +import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType; +import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages; +import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages; +import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId; +import org.eclipse.wst.validation.internal.provisional.core.IMessage; + +/** + * <code>orm.xml</code> embedded mapping + */ +public class OrmEclipseLinkEmbeddedIdMapping + extends AbstractOrmEmbeddedIdMapping<XmlEmbeddedId> +{ + + public OrmEclipseLinkEmbeddedIdMapping(OrmPersistentAttribute parent, XmlEmbeddedId xmlMapping) { + super(parent, xmlMapping); + } + + + // ********** attribute type ********** + + @Override + protected String buildSpecifiedAttributeType() { + return this.xmlAttributeMapping.getAttributeType(); + } + + @Override + protected void setSpecifiedAttributeTypeInXml(String attributeType) { + this.xmlAttributeMapping.setAttributeType(attributeType); + } + + // ********** validation ********** + + @Override + protected boolean validateTargetEmbeddable(List<IMessage> messages) { + if (this.isVirtualAccess()) { + if (StringTools.stringIsEmpty(this.getAttributeType())) { + messages.add( + DefaultEclipseLinkJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED, + new String[] {this.getName()}, + this, + this.getAttributeTypeTextRange() + ) + ); + return false; + } + if (this.getResolvedAttributeType() == null) { + IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedAttributeType()); + if (jdtType == null) { + messages.add( + DefaultEclipseLinkJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST, + new String[] {this.getFullyQualifiedAttributeType()}, + this, + this.getAttributeTypeTextRange() + ) + ); + return false; + } + } + } + return super.validateTargetEmbeddable(messages); + } + + protected boolean isVirtualAccess() { + return this.getPersistentAttribute().getAccess() == EclipseLinkAccessType.VIRTUAL; + } + + @Override + protected TextRange getAttributeTypeTextRange() { + return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange()); + } +}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddedMapping.java new file mode 100644 index 0000000000..bbfb4b7073 --- /dev/null +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddedMapping.java @@ -0,0 +1,92 @@ +/******************************************************************************* + * Copyright (c) 2012 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.jpa.eclipselink.core.internal.context.orm; + +import java.util.List; +import org.eclipse.jdt.core.IType; +import org.eclipse.jpt.common.core.internal.utility.JDTTools; +import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.common.utility.internal.StringTools; +import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute; +import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.AbstractOrmEmbeddedMapping; +import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType; +import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages; +import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages; +import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded; +import org.eclipse.wst.validation.internal.provisional.core.IMessage; + +/** + * <code>orm.xml</code> embedded mapping + */ +public class OrmEclipseLinkEmbeddedMapping + extends AbstractOrmEmbeddedMapping<XmlEmbedded> +{ + public OrmEclipseLinkEmbeddedMapping(OrmPersistentAttribute parent, XmlEmbedded xmlMapping) { + super(parent, xmlMapping); + } + + + // ********** attribute type ********** + + @Override + protected String buildSpecifiedAttributeType() { + return this.xmlAttributeMapping.getAttributeType(); + } + + @Override + protected void setSpecifiedAttributeTypeInXml(String attributeType) { + this.xmlAttributeMapping.setAttributeType(attributeType); + } + + // ********** validation ********** + + @Override + protected boolean validateTargetEmbeddable(List<IMessage> messages) { + if (this.isVirtualAccess()) { + if (StringTools.stringIsEmpty(this.getAttributeType())) { + messages.add( + DefaultEclipseLinkJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED, + new String[] {this.getName()}, + this, + this.getAttributeTypeTextRange() + ) + ); + return false; + } + if (this.getResolvedAttributeType() == null) { + IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedAttributeType()); + if (jdtType == null) { + messages.add( + DefaultEclipseLinkJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST, + new String[] {this.getFullyQualifiedAttributeType()}, + this, + this.getAttributeTypeTextRange() + ) + ); + return false; + } + } + } + return super.validateTargetEmbeddable(messages); + } + + protected boolean isVirtualAccess() { + return this.getPersistentAttribute().getAccess() == EclipseLinkAccessType.VIRTUAL; + } + + @Override + protected TextRange getAttributeTypeTextRange() { + return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange()); + } +}
\ No newline at end of file diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.java index 0d2d8161b2..7e7847d221 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -12,14 +12,21 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm; import java.util.List; import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.IType; +import org.eclipse.jpt.common.core.internal.utility.JDTTools; +import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.common.utility.internal.StringTools; import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; import org.eclipse.jpt.jpa.core.context.orm.OrmConverter; import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute; +import org.eclipse.jpt.jpa.core.internal.context.MappingTools; import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmIdMapping; +import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkIdMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable; import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer; +import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages; +import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId; import org.eclipse.text.edits.ReplaceEdit; import org.eclipse.wst.validation.internal.provisional.core.IMessage; @@ -61,6 +68,19 @@ public class OrmEclipseLinkIdMapping } + // ********** attribute type ********** + + @Override + protected String buildSpecifiedAttributeType() { + return this.xmlAttributeMapping.getAttributeType(); + } + + @Override + protected void setSpecifiedAttributeTypeInXml(String attributeType) { + this.xmlAttributeMapping.setAttributeType(attributeType); + } + + // ********** mutable ********** public EclipseLinkMutable getMutable() { @@ -116,6 +136,51 @@ public class OrmEclipseLinkIdMapping @Override public void validate(List<IMessage> messages, IReporter reporter) { super.validate(messages, reporter); + this.validateAttributeType(messages); // TODO mutable validation } + + //TODO copied from OrmEclipseLinkBasicMapping + protected void validateAttributeType(List<IMessage> messages) { + if (this.isVirtualAccess()) { + if (StringTools.stringIsEmpty(this.getAttributeType())) { + messages.add( + DefaultEclipseLinkJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED, + new String[] {this.getName()}, + this, + this.getAttributeTypeTextRange() + ) + ); + return; + } + if (MappingTools.typeIsBasic(this.getJavaProject(), this.getFullyQualifiedAttributeType())) { + return; + } + if (this.getResolvedAttributeType() == null) { + IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedAttributeType()); + if (jdtType == null) { + messages.add( + DefaultEclipseLinkJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST, + new String[] {this.getFullyQualifiedAttributeType()}, + this, + this.getAttributeTypeTextRange() + ) + ); + } + return; + } + } + } + + protected boolean isVirtualAccess() { + return getPersistentAttribute().getAccess() == EclipseLinkAccessType.VIRTUAL; + } + + protected TextRange getAttributeTypeTextRange() { + return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange()); + } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.java index 2f03523111..42988ff64e 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -12,12 +12,18 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm; import java.util.List; import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.IType; +import org.eclipse.jpt.common.core.internal.utility.JDTTools; +import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.common.utility.internal.StringTools; import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmManyToManyMapping; +import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkManyToManyMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer; +import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages; +import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany; import org.eclipse.text.edits.ReplaceEdit; import org.eclipse.wst.validation.internal.provisional.core.IMessage; @@ -59,6 +65,19 @@ public class OrmEclipseLinkManyToManyMapping } + // ********** attribute type ********** + + @Override + protected String buildSpecifiedAttributeType() { + return this.xmlAttributeMapping.getAttributeType(); + } + + @Override + protected void setSpecifiedAttributeTypeInXml(String attributeType) { + this.xmlAttributeMapping.setAttributeType(attributeType); + } + + // ********** join fetch ********** public EclipseLinkJoinFetch getJoinFetch() { @@ -104,4 +123,47 @@ public class OrmEclipseLinkManyToManyMapping super.validate(messages, reporter); // TODO join fetch validation } + + @Override + protected void validateAttributeType(List<IMessage> messages, IReporter reporter) { + if (this.isVirtualAccess()) { + if (StringTools.stringIsEmpty(this.getAttributeType())) { + messages.add( + DefaultEclipseLinkJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED, + new String[] {this.getName()}, + this, + this.getAttributeTypeTextRange() + ) + ); + return; + } + if (this.getResolvedAttributeType() == null) { + IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedAttributeType()); + if (jdtType == null) { + messages.add( + DefaultEclipseLinkJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST, + new String[] {this.getFullyQualifiedAttributeType()}, + this, + this.getAttributeTypeTextRange() + ) + ); + return; + } + } + } + super.validateAttributeType(messages, reporter); + } + + protected boolean isVirtualAccess() { + return getPersistentAttribute().getAccess() == EclipseLinkAccessType.VIRTUAL; + } + + @Override + protected TextRange getAttributeTypeTextRange() { + return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange()); + } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.java index 761e867212..571ee0fe0e 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -12,15 +12,21 @@ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm; import java.util.List; import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.IType; +import org.eclipse.jpt.common.core.internal.utility.JDTTools; +import org.eclipse.jpt.common.core.utility.TextRange; +import org.eclipse.jpt.common.utility.internal.StringTools; import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute; import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmOneToManyMapping; import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToManyRelationship2_0; +import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyMapping2_0; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned; import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmOneToManyRelationship2_0; import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer; +import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages; +import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany; import org.eclipse.text.edits.ReplaceEdit; import org.eclipse.wst.validation.internal.provisional.core.IMessage; @@ -67,6 +73,19 @@ public class OrmEclipseLinkOneToManyMapping } + // ********** attribute type ********** + + @Override + protected String buildSpecifiedAttributeType() { + return this.xmlAttributeMapping.getAttributeType(); + } + + @Override + protected void setSpecifiedAttributeTypeInXml(String attributeType) { + this.xmlAttributeMapping.setAttributeType(attributeType); + } + + // ********** private owned ********** public EclipseLinkPrivateOwned getPrivateOwned() { @@ -134,4 +153,48 @@ public class OrmEclipseLinkOneToManyMapping super.validate(messages, reporter); // TODO - private owned, join fetch validation } + + + @Override + protected void validateAttributeType(List<IMessage> messages, IReporter reporter) { + if (this.isVirtualAccess()) { + if (StringTools.stringIsEmpty(this.getAttributeType())) { + messages.add( + DefaultEclipseLinkJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED, + new String[] {this.getName()}, + this, + this.getAttributeTypeTextRange() + ) + ); + return; + } + if (this.getResolvedAttributeType() == null) { + IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedAttributeType()); + if (jdtType == null) { + messages.add( + DefaultEclipseLinkJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST, + new String[] {this.getFullyQualifiedAttributeType()}, + this, + this.getAttributeTypeTextRange() + ) + ); + return; + } + } + } + super.validateAttributeType(messages, reporter); + } + + protected boolean isVirtualAccess() { + return getPersistentAttribute().getAccess() == EclipseLinkAccessType.VIRTUAL; + } + + @Override + protected TextRange getAttributeTypeTextRange() { + return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange()); + } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistentAttribute.java index 708b9218a1..b95dd6f0e7 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistentAttribute.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistentAttribute.java @@ -9,21 +9,16 @@ ******************************************************************************/ package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm; -import java.util.List; import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute; import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType; import org.eclipse.jpt.jpa.core.internal.context.JptValidator; import org.eclipse.jpt.jpa.core.internal.context.orm.SpecifiedOrmPersistentAttribute; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessMethodsHolder; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType; -import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages; -import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages; import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkPersistentAttributeValidator; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping; -import org.eclipse.wst.validation.internal.provisional.core.IMessage; -import org.eclipse.wst.validation.internal.provisional.core.IReporter; /** * EclipseLink @@ -141,32 +136,6 @@ public class OrmEclipseLinkPersistentAttribute return (XmlAttributeMapping) super.getXmlAttributeMapping(); } - - // ********** validation ********** - - - //TODO validate that the attribute-type exists on the classpath - @Override - protected void validateAttribute(List<IMessage> messages, IReporter reporter) { - super.validateAttribute(messages, reporter); - //TODO many-to-one needs to specify target-entity instead of attribute-type, move this validation to the mappings? - if (getAccess() == EclipseLinkAccessType.VIRTUAL) { - if (getTypeName() == null) { - messages.add( - DefaultEclipseLinkJpaValidationMessages.buildMessage( - IMessage.HIGH_SEVERITY, - EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED, - new String[] { - this.getName() - }, - this.mapping, - this.mapping.getSelectionTextRange() - ) - ); - } - } - } - @Override protected JptValidator buildAttibuteValidator() { return new EclipseLinkPersistentAttributeValidator(this, buildTextRangeResolver()); diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructureMapping2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructureMapping2_3.java index 31347ef45b..eb9be0e741 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructureMapping2_3.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructureMapping2_3.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011 Oracle. All rights reserved. + * Copyright (c) 2011, 2012 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. @@ -25,6 +25,22 @@ public class OrmEclipseLinkStructureMapping2_3 super(parent, xmlMapping); } + + // ********** attribute type ********** + + @Override + protected String buildSpecifiedAttributeType() { + return this.xmlAttributeMapping.getAttributeType(); + } + + @Override + protected void setSpecifiedAttributeTypeInXml(String attributeType) { + this.xmlAttributeMapping.setAttributeType(attributeType); + } + + + // ********** misc ********** + public String getKey() { return EclipseLinkMappingKeys.STRUCTURE_ATTRIBUTE_MAPPING_KEY; } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java index de3ed85c22..8bb804af28 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2009 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -24,7 +24,23 @@ public class OrmEclipseLinkTransformationMapping public OrmEclipseLinkTransformationMapping(OrmPersistentAttribute parent, XmlTransformation xmlMapping) { super(parent, xmlMapping); } - + + + // ********** attribute type ********** + + @Override + protected String buildSpecifiedAttributeType() { + return this.xmlAttributeMapping.getAttributeType(); + } + + @Override + protected void setSpecifiedAttributeTypeInXml(String attributeType) { + this.xmlAttributeMapping.setAttributeType(attributeType); + } + + + // ********** misc ********** + public String getKey() { return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY; } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java index e9b0b2b1b2..26d7b618ba 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2011 Oracle. All rights reserved. + * Copyright (c) 2008, 2012 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. @@ -13,11 +13,16 @@ import java.util.List; import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.IType; +import org.eclipse.jpt.common.core.internal.utility.JDTTools; +import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.common.utility.internal.ArrayTools; +import org.eclipse.jpt.common.utility.internal.StringTools; import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable; import org.eclipse.jpt.jpa.core.context.orm.OrmConverter; import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute; +import org.eclipse.jpt.jpa.core.internal.context.MappingTools; import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmVersionMapping; +import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable; import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVersionMapping; import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping; @@ -65,6 +70,19 @@ public class OrmEclipseLinkVersionMapping } + // ********** attribute type ********** + + @Override + protected String buildSpecifiedAttributeType() { + return this.xmlAttributeMapping.getAttributeType(); + } + + @Override + protected void setSpecifiedAttributeTypeInXml(String attributeType) { + this.xmlAttributeMapping.setAttributeType(attributeType); + } + + // ********** mutable ********** public EclipseLinkMutable getMutable() { @@ -125,7 +143,38 @@ public class OrmEclipseLinkVersionMapping @Override protected void validateAttributeType(List<IMessage> messages) { - if (!ArrayTools.contains(SUPPORTED_TYPE_NAMES, this.getPersistentAttribute().getTypeName())) { + //TODO copied from OrmEclipseLinkBasicMapping + if (this.isVirtualAccess()) { + if (StringTools.stringIsEmpty(this.getAttributeType())) { + messages.add( + DefaultEclipseLinkJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED, + new String[] {this.getName()}, + this, + this.getAttributeTypeTextRange() + ) + ); + return; + } + if (MappingTools.typeIsBasic(this.getJavaProject(), this.getFullyQualifiedAttributeType())) { + return; + } + IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedAttributeType()); + if (jdtType == null && this.getResolvedAttributeType() == null) { + messages.add( + DefaultEclipseLinkJpaValidationMessages.buildMessage( + IMessage.HIGH_SEVERITY, + EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST, + new String[] {this.getFullyQualifiedAttributeType()}, + this, + this.getAttributeTypeTextRange() + ) + ); + return; + } + } + if (!ArrayTools.contains(SUPPORTED_TYPE_NAMES, this.getAttributeType())) { messages.add( DefaultEclipseLinkJpaValidationMessages.buildMessage( IMessage.HIGH_SEVERITY, @@ -137,4 +186,12 @@ public class OrmEclipseLinkVersionMapping ); } } + + protected boolean isVirtualAccess() { + return getPersistentAttribute().getAccess() == EclipseLinkAccessType.VIRTUAL; + } + + protected TextRange getAttributeTypeTextRange() { + return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange()); + } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentAttribute.java index 0601a8997f..0076d351e7 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentAttribute.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentAttribute.java @@ -82,12 +82,17 @@ public class VirtualJavaPersistentAttribute extends AbstractJavaJpaContextNode throw new UnsupportedOperationException(); } + public String getTypeName() { + String typeName = this.xmlAttributeMapping.getAttributeType(); + return typeName == null ? null : this.getEntityMappings().getFullyQualifiedName(typeName); + } + public boolean typeIsBasic() { return false;//not valid for a default basic mapping, specified in orm.xml } public String getSingleReferenceTargetTypeName() { - return null; //used for building default target entity, must be specified in a virtual mapping + return null; //used for building default target entity/embeddable, must be specified in a virtual mapping } public String getMultiReferenceTargetTypeName() { @@ -245,15 +250,19 @@ public class VirtualJavaPersistentAttribute extends AbstractJavaJpaContextNode return this.getJpaContainerDefinition(this.getTypeName()); } + //I don't think we should be doing this here, I think OrmAttributeMappings should be responsible for their own JpaContainerDefinition + //Generic can just get it from the JavaPersistentAttribute /** * Return the JPA container definition corresponding to the specified type; * return a "null" definition if the specified type is not "assignable to" one of the * container types allowed by the JPA spec. */ protected JpaContainerDefinition getJpaContainerDefinition(String typeName) { - for (JpaContainerDefinition definition : getJpaContainerDefinitions()) { - if (definition.isAssignableFrom(typeName)) { - return definition; + if (typeName != null) { + for (JpaContainerDefinition definition : getJpaContainerDefinitions()) { + if (definition.isAssignableFrom(typeName)) { + return definition; + } } } return JpaContainerDefinition.Null.instance(); @@ -375,11 +384,6 @@ public class VirtualJavaPersistentAttribute extends AbstractJavaJpaContextNode return (EntityMappings) getParent().getMappingFileRoot(); } - public String getTypeName() { - String typeName = this.xmlAttributeMapping.getTypeName(); - return this.getEntityMappings().getFullyQualifiedName(typeName); - } - public String getPrimaryKeyColumnName() { throw new UnsupportedOperationException("Owing orm persistent attribute should handle, this should not be called."); //$NON-NLS-1$ } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentType.java index 47309d36a8..4ab2d4c538 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentType.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentType.java @@ -22,6 +22,7 @@ import org.eclipse.jpt.common.core.resource.java.JavaResourceType; import org.eclipse.jpt.common.core.utility.BodySourceWriter; import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.common.utility.internal.CollectionTools; +import org.eclipse.jpt.common.utility.internal.StringTools; import org.eclipse.jpt.common.utility.internal.iterables.ChainIterable; import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable; import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable; @@ -170,7 +171,7 @@ public class VirtualJavaPersistentType * hierarchy are handled in {@link #buildSuperPersistentType()}. */ protected PersistentType resolveSuperPersistentType(String typeName, Collection<JavaResourceType> visited) { - if (typeName == null) { + if (StringTools.stringIsEmpty(typeName)) { return null; } PersistentType spt = this.resolvePersistentType(typeName); diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java index 1e620d2a7e..9a17b5212c 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java @@ -197,13 +197,21 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_ARRAY__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; /** + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_ARRAY__ATTRIBUTE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; + /** * The feature id for the '<em><b>Converters</b></em>' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_ARRAY__CONVERTERS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; + public static final int XML_ARRAY__CONVERTERS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; /** * The feature id for the '<em><b>Type Converters</b></em>' containment reference list. * <!-- begin-user-doc --> @@ -211,7 +219,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ARRAY__TYPE_CONVERTERS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; + public static final int XML_ARRAY__TYPE_CONVERTERS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4; /** * The feature id for the '<em><b>Object Type Converters</b></em>' containment reference list. * <!-- begin-user-doc --> @@ -219,7 +227,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ARRAY__OBJECT_TYPE_CONVERTERS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4; + public static final int XML_ARRAY__OBJECT_TYPE_CONVERTERS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5; /** * The feature id for the '<em><b>Struct Converters</b></em>' containment reference list. * <!-- begin-user-doc --> @@ -227,7 +235,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ARRAY__STRUCT_CONVERTERS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5; + public static final int XML_ARRAY__STRUCT_CONVERTERS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6; /** * The feature id for the '<em><b>Lob</b></em>' attribute. * <!-- begin-user-doc --> @@ -235,7 +243,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ARRAY__LOB = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6; + public static final int XML_ARRAY__LOB = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7; /** * The feature id for the '<em><b>Temporal</b></em>' attribute. * <!-- begin-user-doc --> @@ -243,7 +251,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ARRAY__TEMPORAL = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7; + public static final int XML_ARRAY__TEMPORAL = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 8; /** * The feature id for the '<em><b>Enumerated</b></em>' attribute. * <!-- begin-user-doc --> @@ -251,7 +259,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ARRAY__ENUMERATED = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 8; + public static final int XML_ARRAY__ENUMERATED = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 9; /** * The feature id for the '<em><b>Column</b></em>' containment reference. * <!-- begin-user-doc --> @@ -259,7 +267,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ARRAY__COLUMN = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 9; + public static final int XML_ARRAY__COLUMN = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 10; /** * The feature id for the '<em><b>Database Type</b></em>' attribute. * <!-- begin-user-doc --> @@ -267,7 +275,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ARRAY__DATABASE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 10; + public static final int XML_ARRAY__DATABASE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 11; /** * The feature id for the '<em><b>Target Class</b></em>' attribute. * <!-- begin-user-doc --> @@ -275,15 +283,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ARRAY__TARGET_CLASS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 11; - /** - * The feature id for the '<em><b>Attribute Type</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int XML_ARRAY__ATTRIBUTE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 12; + public static final int XML_ARRAY__TARGET_CLASS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 12; /** * The feature id for the '<em><b>Convert</b></em>' attribute. * <!-- begin-user-doc --> @@ -342,13 +342,21 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_ATTRIBUTE_MAPPING__PROPERTIES = OrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; /** + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE = OrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; + /** * The number of structural features of the '<em>Xml Attribute Mapping</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_ATTRIBUTE_MAPPING_FEATURE_COUNT = OrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; + public static final int XML_ATTRIBUTE_MAPPING_FEATURE_COUNT = OrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes <em>Attributes</em>}' class. * <!-- begin-user-doc --> @@ -624,45 +632,45 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_BASIC__RETURN_UPDATE = OrmPackage.XML_BASIC_FEATURE_COUNT + 4; /** - * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * The feature id for the '<em><b>Index</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_BASIC__ATTRIBUTE_TYPE = OrmPackage.XML_BASIC_FEATURE_COUNT + 5; + public static final int XML_BASIC__INDEX = OrmPackage.XML_BASIC_FEATURE_COUNT + 5; /** - * The feature id for the '<em><b>Index</b></em>' containment reference. + * The feature id for the '<em><b>Cache Index</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_BASIC__INDEX = OrmPackage.XML_BASIC_FEATURE_COUNT + 6; + public static final int XML_BASIC__CACHE_INDEX = OrmPackage.XML_BASIC_FEATURE_COUNT + 6; /** - * The feature id for the '<em><b>Cache Index</b></em>' containment reference. + * The feature id for the '<em><b>Access Methods</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_BASIC__CACHE_INDEX = OrmPackage.XML_BASIC_FEATURE_COUNT + 7; + public static final int XML_BASIC__ACCESS_METHODS = OrmPackage.XML_BASIC_FEATURE_COUNT + 7; /** - * The feature id for the '<em><b>Access Methods</b></em>' containment reference. + * The feature id for the '<em><b>Properties</b></em>' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_BASIC__ACCESS_METHODS = OrmPackage.XML_BASIC_FEATURE_COUNT + 8; + public static final int XML_BASIC__PROPERTIES = OrmPackage.XML_BASIC_FEATURE_COUNT + 8; /** - * The feature id for the '<em><b>Properties</b></em>' containment reference list. + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_BASIC__PROPERTIES = OrmPackage.XML_BASIC_FEATURE_COUNT + 9; + public static final int XML_BASIC__ATTRIBUTE_TYPE = OrmPackage.XML_BASIC_FEATURE_COUNT + 9; /** * The feature id for the '<em><b>Mutable</b></em>' attribute. * <!-- begin-user-doc --> @@ -761,13 +769,21 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_BASIC_COLLECTION__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; /** + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_BASIC_COLLECTION__ATTRIBUTE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; + /** * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_BASIC_COLLECTION__CASCADE_ON_DELETE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; + public static final int XML_BASIC_COLLECTION__CASCADE_ON_DELETE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; /** * The number of structural features of the '<em>Xml Basic Collection</em>' class. * <!-- begin-user-doc --> @@ -775,7 +791,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_BASIC_COLLECTION_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; + public static final int XML_BASIC_COLLECTION_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap <em>Xml Basic Map</em>}' class. * <!-- begin-user-doc --> @@ -818,13 +834,21 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_BASIC_MAP__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; /** + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_BASIC_MAP__ATTRIBUTE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; + /** * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_BASIC_MAP__CASCADE_ON_DELETE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; + public static final int XML_BASIC_MAP__CASCADE_ON_DELETE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; /** * The number of structural features of the '<em>Xml Basic Map</em>' class. * <!-- begin-user-doc --> @@ -832,7 +856,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_BASIC_MAP_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; + public static final int XML_BASIC_MAP_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4; /** * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch <em>Xml Batch Fetch</em>}' class. * <!-- begin-user-doc --> @@ -1652,13 +1676,21 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_ELEMENT_COLLECTION__PROPERTIES = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 1; /** + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 2; + /** * The feature id for the '<em><b>Convert</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_ELEMENT_COLLECTION__CONVERT = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 2; + public static final int XML_ELEMENT_COLLECTION__CONVERT = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 3; /** * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list. * <!-- begin-user-doc --> @@ -1666,7 +1698,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 3; + public static final int XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 4; /** * The feature id for the '<em><b>Converters</b></em>' containment reference list. * <!-- begin-user-doc --> @@ -1674,7 +1706,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ELEMENT_COLLECTION__CONVERTERS = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 4; + public static final int XML_ELEMENT_COLLECTION__CONVERTERS = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 5; /** * The feature id for the '<em><b>Type Converters</b></em>' containment reference list. * <!-- begin-user-doc --> @@ -1682,7 +1714,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ELEMENT_COLLECTION__TYPE_CONVERTERS = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 5; + public static final int XML_ELEMENT_COLLECTION__TYPE_CONVERTERS = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 6; /** * The feature id for the '<em><b>Object Type Converters</b></em>' containment reference list. * <!-- begin-user-doc --> @@ -1690,7 +1722,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 6; + public static final int XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 7; /** * The feature id for the '<em><b>Struct Converters</b></em>' containment reference list. * <!-- begin-user-doc --> @@ -1698,7 +1730,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 7; + public static final int XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 8; /** * The feature id for the '<em><b>Map Key Convert</b></em>' attribute. * <!-- begin-user-doc --> @@ -1706,7 +1738,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 8; + public static final int XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 9; /** * The feature id for the '<em><b>Join Fetch</b></em>' attribute. * <!-- begin-user-doc --> @@ -1714,7 +1746,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ELEMENT_COLLECTION__JOIN_FETCH = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 9; + public static final int XML_ELEMENT_COLLECTION__JOIN_FETCH = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 10; /** * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference. * <!-- begin-user-doc --> @@ -1722,15 +1754,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ELEMENT_COLLECTION__BATCH_FETCH = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 10; - /** - * The feature id for the '<em><b>Attribute Type</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 11; + public static final int XML_ELEMENT_COLLECTION__BATCH_FETCH = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 11; /** * The feature id for the '<em><b>Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -2086,29 +2110,29 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_EMBEDDED__ASSOCIATION_OVERRIDES = OrmPackage.XML_EMBEDDED__ASSOCIATION_OVERRIDES; /** - * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * The feature id for the '<em><b>Access Methods</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_EMBEDDED__ATTRIBUTE_TYPE = OrmPackage.XML_EMBEDDED_FEATURE_COUNT + 0; + public static final int XML_EMBEDDED__ACCESS_METHODS = OrmPackage.XML_EMBEDDED_FEATURE_COUNT + 0; /** - * The feature id for the '<em><b>Access Methods</b></em>' containment reference. + * The feature id for the '<em><b>Properties</b></em>' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_EMBEDDED__ACCESS_METHODS = OrmPackage.XML_EMBEDDED_FEATURE_COUNT + 1; + public static final int XML_EMBEDDED__PROPERTIES = OrmPackage.XML_EMBEDDED_FEATURE_COUNT + 1; /** - * The feature id for the '<em><b>Properties</b></em>' containment reference list. + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_EMBEDDED__PROPERTIES = OrmPackage.XML_EMBEDDED_FEATURE_COUNT + 2; + public static final int XML_EMBEDDED__ATTRIBUTE_TYPE = OrmPackage.XML_EMBEDDED_FEATURE_COUNT + 2; /** * The number of structural features of the '<em>Xml Embedded</em>' class. * <!-- begin-user-doc --> @@ -2151,29 +2175,29 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_EMBEDDED_ID__ATTRIBUTE_OVERRIDES = OrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_OVERRIDES; /** - * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * The feature id for the '<em><b>Access Methods</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_EMBEDDED_ID__ATTRIBUTE_TYPE = OrmPackage.XML_EMBEDDED_ID_FEATURE_COUNT + 0; + public static final int XML_EMBEDDED_ID__ACCESS_METHODS = OrmPackage.XML_EMBEDDED_ID_FEATURE_COUNT + 0; /** - * The feature id for the '<em><b>Access Methods</b></em>' containment reference. + * The feature id for the '<em><b>Properties</b></em>' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_EMBEDDED_ID__ACCESS_METHODS = OrmPackage.XML_EMBEDDED_ID_FEATURE_COUNT + 1; + public static final int XML_EMBEDDED_ID__PROPERTIES = OrmPackage.XML_EMBEDDED_ID_FEATURE_COUNT + 1; /** - * The feature id for the '<em><b>Properties</b></em>' containment reference list. + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_EMBEDDED_ID__PROPERTIES = OrmPackage.XML_EMBEDDED_ID_FEATURE_COUNT + 2; + public static final int XML_EMBEDDED_ID__ATTRIBUTE_TYPE = OrmPackage.XML_EMBEDDED_ID_FEATURE_COUNT + 2; /** * The number of structural features of the '<em>Xml Embedded Id</em>' class. * <!-- begin-user-doc --> @@ -3584,45 +3608,45 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_ID__GENERATED_VALUE = OrmPackage.XML_ID__GENERATED_VALUE; /** - * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * The feature id for the '<em><b>Index</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_ID__ATTRIBUTE_TYPE = OrmPackage.XML_ID_FEATURE_COUNT + 0; + public static final int XML_ID__INDEX = OrmPackage.XML_ID_FEATURE_COUNT + 0; /** - * The feature id for the '<em><b>Index</b></em>' containment reference. + * The feature id for the '<em><b>Cache Index</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_ID__INDEX = OrmPackage.XML_ID_FEATURE_COUNT + 1; + public static final int XML_ID__CACHE_INDEX = OrmPackage.XML_ID_FEATURE_COUNT + 1; /** - * The feature id for the '<em><b>Cache Index</b></em>' containment reference. + * The feature id for the '<em><b>Access Methods</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_ID__CACHE_INDEX = OrmPackage.XML_ID_FEATURE_COUNT + 2; + public static final int XML_ID__ACCESS_METHODS = OrmPackage.XML_ID_FEATURE_COUNT + 2; /** - * The feature id for the '<em><b>Access Methods</b></em>' containment reference. + * The feature id for the '<em><b>Properties</b></em>' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_ID__ACCESS_METHODS = OrmPackage.XML_ID_FEATURE_COUNT + 3; + public static final int XML_ID__PROPERTIES = OrmPackage.XML_ID_FEATURE_COUNT + 3; /** - * The feature id for the '<em><b>Properties</b></em>' containment reference list. + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_ID__PROPERTIES = OrmPackage.XML_ID_FEATURE_COUNT + 4; + public static final int XML_ID__ATTRIBUTE_TYPE = OrmPackage.XML_ID_FEATURE_COUNT + 4; /** * The feature id for the '<em><b>Mutable</b></em>' attribute. * <!-- begin-user-doc --> @@ -4008,21 +4032,13 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_MANY_TO_MANY__BATCH_FETCH = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 6; /** - * The feature id for the '<em><b>Attribute Type</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int XML_MANY_TO_MANY__ATTRIBUTE_TYPE = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 7; - /** * The feature id for the '<em><b>Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_MANY_TO_MANY__PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 8; + public static final int XML_MANY_TO_MANY__PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 7; /** * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -4030,7 +4046,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_MANY_TO_MANY__REPLICATION_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 9; + public static final int XML_MANY_TO_MANY__REPLICATION_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 8; /** * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -4038,7 +4054,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 10; + public static final int XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 9; /** * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -4046,7 +4062,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_MANY_TO_MANY__PINNED_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 11; + public static final int XML_MANY_TO_MANY__PINNED_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 10; /** * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -4054,7 +4070,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_MANY_TO_MANY__RANGE_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 12; + public static final int XML_MANY_TO_MANY__RANGE_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 11; /** * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -4062,7 +4078,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_MANY_TO_MANY__VALUE_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 13; + public static final int XML_MANY_TO_MANY__VALUE_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 12; /** * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -4070,7 +4086,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_MANY_TO_MANY__HASH_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 14; + public static final int XML_MANY_TO_MANY__HASH_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 13; /** * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -4078,7 +4094,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_MANY_TO_MANY__UNION_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 15; + public static final int XML_MANY_TO_MANY__UNION_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 14; /** * The feature id for the '<em><b>Partitioned</b></em>' attribute. * <!-- begin-user-doc --> @@ -4086,7 +4102,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_MANY_TO_MANY__PARTITIONED = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 16; + public static final int XML_MANY_TO_MANY__PARTITIONED = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 15; /** * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute. * <!-- begin-user-doc --> @@ -4094,7 +4110,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_MANY_TO_MANY__CASCADE_ON_DELETE = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 17; + public static final int XML_MANY_TO_MANY__CASCADE_ON_DELETE = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 16; /** * The feature id for the '<em><b>Non Cacheable</b></em>' attribute. * <!-- begin-user-doc --> @@ -4102,7 +4118,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_MANY_TO_MANY__NON_CACHEABLE = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 18; + public static final int XML_MANY_TO_MANY__NON_CACHEABLE = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 17; /** * The feature id for the '<em><b>Access Methods</b></em>' containment reference. * <!-- begin-user-doc --> @@ -4110,7 +4126,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_MANY_TO_MANY__ACCESS_METHODS = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 19; + public static final int XML_MANY_TO_MANY__ACCESS_METHODS = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 18; /** * The feature id for the '<em><b>Properties</b></em>' containment reference list. * <!-- begin-user-doc --> @@ -4118,7 +4134,15 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_MANY_TO_MANY__PROPERTIES = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 20; + public static final int XML_MANY_TO_MANY__PROPERTIES = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 19; + /** + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_MANY_TO_MANY__ATTRIBUTE_TYPE = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 20; /** * The feature id for the '<em><b>Join Fetch</b></em>' attribute. * <!-- begin-user-doc --> @@ -4320,13 +4344,21 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_MANY_TO_ONE__PROPERTIES = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 12; /** + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_MANY_TO_ONE__ATTRIBUTE_TYPE = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 13; + /** * The feature id for the '<em><b>Join Fetch</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_MANY_TO_ONE__JOIN_FETCH = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 13; + public static final int XML_MANY_TO_ONE__JOIN_FETCH = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 14; /** * The number of structural features of the '<em>Xml Many To One</em>' class. * <!-- begin-user-doc --> @@ -4334,7 +4366,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_MANY_TO_ONE_FEATURE_COUNT = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 14; + public static final int XML_MANY_TO_ONE_FEATURE_COUNT = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 15; /** * The feature id for the '<em><b>Access</b></em>' attribute. * <!-- begin-user-doc --> @@ -5261,21 +5293,13 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_ONE_TO_MANY__BATCH_FETCH = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 6; /** - * The feature id for the '<em><b>Attribute Type</b></em>' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @generated - * @ordered - */ - public static final int XML_ONE_TO_MANY__ATTRIBUTE_TYPE = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 7; - /** * The feature id for the '<em><b>Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 8; + public static final int XML_ONE_TO_MANY__PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 7; /** * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -5283,7 +5307,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__REPLICATION_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 9; + public static final int XML_ONE_TO_MANY__REPLICATION_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 8; /** * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -5291,7 +5315,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 10; + public static final int XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 9; /** * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -5299,7 +5323,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__PINNED_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 11; + public static final int XML_ONE_TO_MANY__PINNED_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 10; /** * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -5307,7 +5331,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__RANGE_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 12; + public static final int XML_ONE_TO_MANY__RANGE_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 11; /** * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -5315,7 +5339,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__VALUE_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 13; + public static final int XML_ONE_TO_MANY__VALUE_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 12; /** * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -5323,7 +5347,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__HASH_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 14; + public static final int XML_ONE_TO_MANY__HASH_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 13; /** * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -5331,7 +5355,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__UNION_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 15; + public static final int XML_ONE_TO_MANY__UNION_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 14; /** * The feature id for the '<em><b>Partitioned</b></em>' attribute. * <!-- begin-user-doc --> @@ -5339,7 +5363,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__PARTITIONED = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 16; + public static final int XML_ONE_TO_MANY__PARTITIONED = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 15; /** * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute. * <!-- begin-user-doc --> @@ -5347,7 +5371,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__CASCADE_ON_DELETE = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 17; + public static final int XML_ONE_TO_MANY__CASCADE_ON_DELETE = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 16; /** * The feature id for the '<em><b>Noncacheable</b></em>' attribute. * <!-- begin-user-doc --> @@ -5355,7 +5379,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__NONCACHEABLE = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 18; + public static final int XML_ONE_TO_MANY__NONCACHEABLE = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 17; /** * The feature id for the '<em><b>Delete All</b></em>' attribute. * <!-- begin-user-doc --> @@ -5363,7 +5387,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__DELETE_ALL = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 19; + public static final int XML_ONE_TO_MANY__DELETE_ALL = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 18; /** * The feature id for the '<em><b>Access Methods</b></em>' containment reference. * <!-- begin-user-doc --> @@ -5371,7 +5395,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__ACCESS_METHODS = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 20; + public static final int XML_ONE_TO_MANY__ACCESS_METHODS = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 19; /** * The feature id for the '<em><b>Properties</b></em>' containment reference list. * <!-- begin-user-doc --> @@ -5379,7 +5403,15 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ONE_TO_MANY__PROPERTIES = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 21; + public static final int XML_ONE_TO_MANY__PROPERTIES = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 20; + /** + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_ONE_TO_MANY__ATTRIBUTE_TYPE = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 21; /** * The feature id for the '<em><b>Private Owned</b></em>' attribute. * <!-- begin-user-doc --> @@ -5621,13 +5653,21 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_ONE_TO_ONE__PROPERTIES = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 13; /** + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_ONE_TO_ONE__ATTRIBUTE_TYPE = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 14; + /** * The feature id for the '<em><b>Private Owned</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_ONE_TO_ONE__PRIVATE_OWNED = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 14; + public static final int XML_ONE_TO_ONE__PRIVATE_OWNED = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 15; /** * The feature id for the '<em><b>Join Fetch</b></em>' attribute. * <!-- begin-user-doc --> @@ -5635,7 +5675,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ONE_TO_ONE__JOIN_FETCH = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 15; + public static final int XML_ONE_TO_ONE__JOIN_FETCH = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 16; /** * The number of structural features of the '<em>Xml One To One</em>' class. * <!-- begin-user-doc --> @@ -5643,7 +5683,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_ONE_TO_ONE_FEATURE_COUNT = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 16; + public static final int XML_ONE_TO_ONE_FEATURE_COUNT = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 17; /** * The feature id for the '<em><b>Type</b></em>' attribute. * <!-- begin-user-doc --> @@ -6735,29 +6775,29 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_TRANSFORMATION__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME; /** - * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * The feature id for the '<em><b>Access Methods</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_TRANSFORMATION__ATTRIBUTE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; + public static final int XML_TRANSFORMATION__ACCESS_METHODS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0; /** - * The feature id for the '<em><b>Access Methods</b></em>' containment reference. + * The feature id for the '<em><b>Properties</b></em>' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_TRANSFORMATION__ACCESS_METHODS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; + public static final int XML_TRANSFORMATION__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; /** - * The feature id for the '<em><b>Properties</b></em>' containment reference list. + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_TRANSFORMATION__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; + public static final int XML_TRANSFORMATION__ATTRIBUTE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; /** * The number of structural features of the '<em>Xml Transformation</em>' class. * <!-- begin-user-doc --> @@ -6799,13 +6839,21 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_TRANSIENT__PROPERTIES = OrmPackage.XML_TRANSIENT_FEATURE_COUNT + 1; /** + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_TRANSIENT__ATTRIBUTE_TYPE = OrmPackage.XML_TRANSIENT_FEATURE_COUNT + 2; + /** * The number of structural features of the '<em>Xml Transient</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_TRANSIENT_FEATURE_COUNT = OrmPackage.XML_TRANSIENT_FEATURE_COUNT + 2; + public static final int XML_TRANSIENT_FEATURE_COUNT = OrmPackage.XML_TRANSIENT_FEATURE_COUNT + 3; /** * The feature id for the '<em><b>Name</b></em>' attribute. * <!-- begin-user-doc --> @@ -6994,13 +7042,21 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_VARIABLE_ONE_TO_ONE__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1; /** + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + public static final int XML_VARIABLE_ONE_TO_ONE__ATTRIBUTE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; + /** * The feature id for the '<em><b>Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_VARIABLE_ONE_TO_ONE__PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2; + public static final int XML_VARIABLE_ONE_TO_ONE__PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; /** * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -7008,7 +7064,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3; + public static final int XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4; /** * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -7016,7 +7072,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4; + public static final int XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5; /** * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -7024,7 +7080,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5; + public static final int XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6; /** * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -7032,7 +7088,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6; + public static final int XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7; /** * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -7040,7 +7096,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7; + public static final int XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 8; /** * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -7048,7 +7104,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 8; + public static final int XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 9; /** * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> @@ -7056,7 +7112,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 9; + public static final int XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 10; /** * The feature id for the '<em><b>Partitioned</b></em>' attribute. * <!-- begin-user-doc --> @@ -7064,7 +7120,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_VARIABLE_ONE_TO_ONE__PARTITIONED = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 10; + public static final int XML_VARIABLE_ONE_TO_ONE__PARTITIONED = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 11; /** * The feature id for the '<em><b>Non Cacheable</b></em>' attribute. * <!-- begin-user-doc --> @@ -7072,7 +7128,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 11; + public static final int XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 12; /** * The feature id for the '<em><b>Target Interface</b></em>' attribute. * <!-- begin-user-doc --> @@ -7080,7 +7136,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_VARIABLE_ONE_TO_ONE__TARGET_INTERFACE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 12; + public static final int XML_VARIABLE_ONE_TO_ONE__TARGET_INTERFACE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 13; /** * The number of structural features of the '<em>Xml Variable One To One</em>' class. * <!-- begin-user-doc --> @@ -7088,7 +7144,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl * @generated * @ordered */ - public static final int XML_VARIABLE_ONE_TO_ONE_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 13; + public static final int XML_VARIABLE_ONE_TO_ONE_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 14; /** * The feature id for the '<em><b>Access</b></em>' attribute. * <!-- begin-user-doc --> @@ -7138,37 +7194,37 @@ public class EclipseLinkOrmPackage extends EPackageImpl */ public static final int XML_VERSION__ENUMERATED = OrmPackage.XML_VERSION__ENUMERATED; /** - * The feature id for the '<em><b>Attribute Type</b></em>' attribute. + * The feature id for the '<em><b>Index</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_VERSION__ATTRIBUTE_TYPE = OrmPackage.XML_VERSION_FEATURE_COUNT + 0; + public static final int XML_VERSION__INDEX = OrmPackage.XML_VERSION_FEATURE_COUNT + 0; /** - * The feature id for the '<em><b>Index</b></em>' containment reference. + * The feature id for the '<em><b>Access Methods</b></em>' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_VERSION__INDEX = OrmPackage.XML_VERSION_FEATURE_COUNT + 1; + public static final int XML_VERSION__ACCESS_METHODS = OrmPackage.XML_VERSION_FEATURE_COUNT + 1; /** - * The feature id for the '<em><b>Access Methods</b></em>' containment reference. + * The feature id for the '<em><b>Properties</b></em>' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_VERSION__ACCESS_METHODS = OrmPackage.XML_VERSION_FEATURE_COUNT + 2; + public static final int XML_VERSION__PROPERTIES = OrmPackage.XML_VERSION_FEATURE_COUNT + 2; /** - * The feature id for the '<em><b>Properties</b></em>' containment reference list. + * The feature id for the '<em><b>Attribute Type</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated * @ordered */ - public static final int XML_VERSION__PROPERTIES = OrmPackage.XML_VERSION_FEATURE_COUNT + 3; + public static final int XML_VERSION__ATTRIBUTE_TYPE = OrmPackage.XML_VERSION_FEATURE_COUNT + 3; /** * The feature id for the '<em><b>Mutable</b></em>' attribute. * <!-- begin-user-doc --> @@ -8061,6 +8117,20 @@ public class EclipseLinkOrmPackage extends EPackageImpl } /** + * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping#getAttributeType <em>Attribute Type</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Attribute Type</em>'. + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping#getAttributeType() + * @see #getXmlAttributeMapping() + * @generated + */ + public EAttribute getXmlAttributeMapping_AttributeType() + { + return (EAttribute)xmlAttributeMappingEClass.getEStructuralFeatures().get(0); + } + + /** * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes <em>Attributes</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -10477,6 +10547,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl xmlArrayEClass = createEClass(XML_ARRAY); xmlAttributeMappingEClass = createEClass(XML_ATTRIBUTE_MAPPING); + createEAttribute(xmlAttributeMappingEClass, XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE); attributesEClass = createEClass(ATTRIBUTES); createEReference(attributesEClass, ATTRIBUTES__BASIC_COLLECTIONS); @@ -10836,10 +10907,8 @@ public class EclipseLinkOrmPackage extends EPackageImpl xmlEmbeddableEClass.getESuperTypes().add(this.getXmlConverterContainer()); xmlEmbeddableEClass.getESuperTypes().add(this.getXmlPropertyContainer()); xmlEmbeddedEClass.getESuperTypes().add(theOrmPackage.getXmlEmbedded()); - xmlEmbeddedEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlEmbedded_2_1()); xmlEmbeddedEClass.getESuperTypes().add(this.getXmlAttributeMapping()); xmlEmbeddedIdEClass.getESuperTypes().add(theOrmPackage.getXmlEmbeddedId()); - xmlEmbeddedIdEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlEmbeddedId_2_1()); xmlEmbeddedIdEClass.getESuperTypes().add(this.getXmlAttributeMapping()); xmlEntityEClass.getESuperTypes().add(theOrmPackage.getXmlEntity()); xmlEntityEClass.getESuperTypes().add(this.getXmlTypeMapping()); @@ -10866,7 +10935,6 @@ public class EclipseLinkOrmPackage extends EPackageImpl xmlFetchGroupEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlFetchGroup_2_1()); xmlHashPartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlHashPartitioning_2_2()); xmlIdEClass.getESuperTypes().add(theOrmPackage.getXmlId()); - xmlIdEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlId_2_1()); xmlIdEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlId_2_2()); xmlIdEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlId_2_4()); xmlIdEClass.getESuperTypes().add(this.getXmlAttributeMapping()); @@ -10952,7 +11020,6 @@ public class EclipseLinkOrmPackage extends EPackageImpl xmlTenantDiscriminatorColumnEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlBaseDiscriminatorColumn()); xmlTenantDiscriminatorColumnEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlTenantDiscriminatorColumn_2_3()); xmlTransformationEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping()); - xmlTransformationEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlTransformation_2_1()); xmlTransformationEClass.getESuperTypes().add(this.getXmlAttributeMapping()); xmlTransientEClass.getESuperTypes().add(theOrmPackage.getXmlTransient()); xmlTransientEClass.getESuperTypes().add(this.getXmlAttributeMapping()); @@ -10965,7 +11032,6 @@ public class EclipseLinkOrmPackage extends EPackageImpl xmlVariableOneToOneEClass.getESuperTypes().add(this.getXmlAttributeMapping()); xmlVariableOneToOneEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlVariableOneToOne_2_2()); xmlVersionEClass.getESuperTypes().add(theOrmPackage.getXmlVersion()); - xmlVersionEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlVersion_2_1()); xmlVersionEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlVersion_2_2()); xmlVersionEClass.getESuperTypes().add(this.getXmlAttributeMapping()); xmlVersionEClass.getESuperTypes().add(this.getXmlMutable()); @@ -10985,8 +11051,7 @@ public class EclipseLinkOrmPackage extends EPackageImpl initEClass(xmlArrayEClass, XmlArray.class, "XmlArray", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEClass(xmlAttributeMappingEClass, XmlAttributeMapping.class, "XmlAttributeMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - addEOperation(xmlAttributeMappingEClass, theXMLTypePackage.getString(), "getTypeName", 0, 1, IS_UNIQUE, IS_ORDERED); + initEAttribute(getXmlAttributeMapping_AttributeType(), theXMLTypePackage.getString(), "attributeType", null, 0, 1, XmlAttributeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(attributesEClass, Attributes.class, "Attributes", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); initEReference(getAttributes_BasicCollections(), this.getXmlBasicCollection(), null, "basicCollections", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); @@ -11378,6 +11443,14 @@ public class EclipseLinkOrmPackage extends EPackageImpl public static final EClass XML_ATTRIBUTE_MAPPING = eINSTANCE.getXmlAttributeMapping(); /** + * The meta object literal for the '<em><b>Attribute Type</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final EAttribute XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE = eINSTANCE.getXmlAttributeMapping_AttributeType(); + + /** * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes <em>Attributes</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlArray.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlArray.java index 37ee6c777a..357727f549 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlArray.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlArray.java @@ -30,6 +30,7 @@ import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage; import org.eclipse.jpt.jpa.core.resource.orm.TemporalType; import org.eclipse.jpt.jpa.core.resource.orm.XmlColumn; import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3; @@ -68,6 +69,26 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut protected EList<XmlProperty> properties; /** + * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; + + /** * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -132,7 +153,7 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut * we don't want a default for enums, just null if the tag does not exist */ protected static final TemporalType TEMPORAL_EDEFAULT = null; - + /** * The cached value of the '{@link #getTemporal() <em>Temporal</em>}' attribute. * <!-- begin-user-doc --> @@ -143,7 +164,6 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut */ protected TemporalType temporal = TEMPORAL_EDEFAULT; - /** * changed this to null and removed the generated flag so emf won't generate over it * we don't want a default for enums, just null if the tag does not exist @@ -211,26 +231,6 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut protected String targetClass = TARGET_CLASS_EDEFAULT; /** - * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getAttributeType() - * @generated - * @ordered - */ - protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getAttributeType() - * @generated - * @ordered - */ - protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; - - /** * The default value of the '{@link #getConvert() <em>Convert</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -697,7 +697,7 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut * <!-- end-user-doc --> * @return the value of the '<em>Attribute Type</em>' attribute. * @see #setAttributeType(String) - * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlArray_2_3_AttributeType() + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ @@ -757,10 +757,6 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ARRAY__CONVERT, oldConvert, convert)); } - public String getTypeName() { - return this.getAttributeType(); - } - /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -803,6 +799,8 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut return getAccessMethods(); case EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES: return getProperties(); + case EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE: + return getAttributeType(); case EclipseLinkOrmPackage.XML_ARRAY__CONVERTERS: return getConverters(); case EclipseLinkOrmPackage.XML_ARRAY__TYPE_CONVERTERS: @@ -823,8 +821,6 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut return getDatabaseType(); case EclipseLinkOrmPackage.XML_ARRAY__TARGET_CLASS: return getTargetClass(); - case EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE: - return getAttributeType(); case EclipseLinkOrmPackage.XML_ARRAY__CONVERT: return getConvert(); } @@ -849,6 +845,9 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut getProperties().clear(); getProperties().addAll((Collection<? extends XmlProperty>)newValue); return; + case EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE: + setAttributeType((String)newValue); + return; case EclipseLinkOrmPackage.XML_ARRAY__CONVERTERS: getConverters().clear(); getConverters().addAll((Collection<? extends XmlConverter>)newValue); @@ -883,9 +882,6 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut case EclipseLinkOrmPackage.XML_ARRAY__TARGET_CLASS: setTargetClass((String)newValue); return; - case EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE: - setAttributeType((String)newValue); - return; case EclipseLinkOrmPackage.XML_ARRAY__CONVERT: setConvert((String)newValue); return; @@ -909,6 +905,9 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut case EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES: getProperties().clear(); return; + case EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE: + setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); + return; case EclipseLinkOrmPackage.XML_ARRAY__CONVERTERS: getConverters().clear(); return; @@ -939,9 +938,6 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut case EclipseLinkOrmPackage.XML_ARRAY__TARGET_CLASS: setTargetClass(TARGET_CLASS_EDEFAULT); return; - case EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE: - setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); - return; case EclipseLinkOrmPackage.XML_ARRAY__CONVERT: setConvert(CONVERT_EDEFAULT); return; @@ -963,6 +959,8 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut return accessMethods != null; case EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES: return properties != null && !properties.isEmpty(); + case EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE: + return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_ARRAY__CONVERTERS: return converters != null && !converters.isEmpty(); case EclipseLinkOrmPackage.XML_ARRAY__TYPE_CONVERTERS: @@ -983,8 +981,6 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut return DATABASE_TYPE_EDEFAULT == null ? databaseType != null : !DATABASE_TYPE_EDEFAULT.equals(databaseType); case EclipseLinkOrmPackage.XML_ARRAY__TARGET_CLASS: return TARGET_CLASS_EDEFAULT == null ? targetClass != null : !TARGET_CLASS_EDEFAULT.equals(targetClass); - case EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE: - return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_ARRAY__CONVERT: return CONVERT_EDEFAULT == null ? convert != null : !CONVERT_EDEFAULT.equals(convert); } @@ -1019,6 +1015,7 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -1057,7 +1054,6 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut { case EclipseLinkOrmPackage.XML_ARRAY__DATABASE_TYPE: return EclipseLinkOrmV2_3Package.XML_ARRAY_23__DATABASE_TYPE; case EclipseLinkOrmPackage.XML_ARRAY__TARGET_CLASS: return EclipseLinkOrmV2_3Package.XML_ARRAY_23__TARGET_CLASS; - case EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_3Package.XML_ARRAY_23__ATTRIBUTE_TYPE; default: return -1; } } @@ -1100,6 +1096,7 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE; default: return -1; } } @@ -1138,7 +1135,6 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut { case EclipseLinkOrmV2_3Package.XML_ARRAY_23__DATABASE_TYPE: return EclipseLinkOrmPackage.XML_ARRAY__DATABASE_TYPE; case EclipseLinkOrmV2_3Package.XML_ARRAY_23__TARGET_CLASS: return EclipseLinkOrmPackage.XML_ARRAY__TARGET_CLASS; - case EclipseLinkOrmV2_3Package.XML_ARRAY_23__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE; default: return -1; } } @@ -1164,7 +1160,9 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); - result.append(" (lob: "); + result.append(" (attributeType: "); + result.append(attributeType); + result.append(", lob: "); result.append(lob); result.append(", temporal: "); result.append(temporal); @@ -1174,8 +1172,6 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut result.append(databaseType); result.append(", targetClass: "); result.append(targetClass); - result.append(", attributeType: "); - result.append(attributeType); result.append(", convert: "); result.append(convert); result.append(')'); @@ -1202,6 +1198,10 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut return getElementTextRange(EclipseLink.CONVERT); } + public TextRange getAttributeTypeTextRange() { + return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE); + } + // ********** translators ********** public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) { @@ -1287,6 +1287,6 @@ public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttribut } protected static Translator buildAttributeTypeTranslator() { - return new Translator(EclipseLink2_3.ARRAY__ATTRIBUTE_TYPE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlArray_2_3_AttributeType(), Translator.DOM_ATTRIBUTE); + return new Translator(EclipseLink2_3.ARRAY__ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE); } } // XmlArray diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAttributeMapping.java index f2cda10aea..319f595948 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAttributeMapping.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAttributeMapping.java @@ -10,6 +10,8 @@ package org.eclipse.jpt.jpa.eclipselink.core.resource.orm; +import org.eclipse.jpt.common.core.utility.TextRange; + /** * <!-- begin-user-doc --> @@ -22,6 +24,12 @@ package org.eclipse.jpt.jpa.eclipselink.core.resource.orm; * will almost certainly be broken (repeatedly) as the API evolves. * <!-- end-user-doc --> * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping#getAttributeType <em>Attribute Type</em>}</li> + * </ul> + * </p> * * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping() * @model kind="class" interface="true" abstract="true" @@ -33,10 +41,31 @@ public interface XmlAttributeMapping { /** + * Returns the value of the '<em><b>Attribute Type</b></em>' attribute. * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> * <!-- end-user-doc --> - * @model kind="operation" dataType="org.eclipse.emf.ecore.xml.type.String" + * @return the value of the '<em>Attribute Type</em>' attribute. + * @see #setAttributeType(String) + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ - String getTypeName(); + String getAttributeType(); + + /** + * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping#getAttributeType <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Attribute Type</em>' attribute. + * @see #getAttributeType() + * @generated + */ + void setAttributeType(String value); + + TextRange getAttributeTypeTextRange(); + } // XmlAttributeMapping diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasic.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasic.java index d78ae0a532..8029aae2d8 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasic.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasic.java @@ -123,24 +123,6 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp protected Boolean returnUpdate = RETURN_UPDATE_EDEFAULT; /** - * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getAttributeType() - * @generated - * @ordered - */ - protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; - /** - * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getAttributeType() - * @generated - * @ordered - */ - protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; - /** * The cached value of the '{@link #getIndex() <em>Index</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -177,6 +159,24 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp */ protected EList<XmlProperty> properties; /** + * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; + /** + * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; + /** * The default value of the '{@link #getMutable() <em>Mutable</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -433,10 +433,6 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp return structConverters; } - public String getTypeName() { - return this.getAttributeType(); - } - /** * Returns the value of the '<em><b>Sequence Generator</b></em>' containment reference. * <!-- begin-user-doc --> @@ -722,7 +718,7 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp * <!-- end-user-doc --> * @return the value of the '<em>Attribute Type</em>' attribute. * @see #setAttributeType(String) - * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic_2_1_AttributeType() + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ @@ -1008,8 +1004,6 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp return getReturnInsert(); case EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE: return getReturnUpdate(); - case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE: - return getAttributeType(); case EclipseLinkOrmPackage.XML_BASIC__INDEX: return getIndex(); case EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX: @@ -1018,6 +1012,8 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp return getAccessMethods(); case EclipseLinkOrmPackage.XML_BASIC__PROPERTIES: return getProperties(); + case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE: + return getAttributeType(); case EclipseLinkOrmPackage.XML_BASIC__MUTABLE: return getMutable(); case EclipseLinkOrmPackage.XML_BASIC__CONVERT: @@ -1060,9 +1056,6 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp case EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE: setReturnUpdate((Boolean)newValue); return; - case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE: - setAttributeType((String)newValue); - return; case EclipseLinkOrmPackage.XML_BASIC__INDEX: setIndex((XmlIndex_2_2)newValue); return; @@ -1076,6 +1069,9 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp getProperties().clear(); getProperties().addAll((Collection<? extends XmlProperty>)newValue); return; + case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE: + setAttributeType((String)newValue); + return; case EclipseLinkOrmPackage.XML_BASIC__MUTABLE: setMutable((Boolean)newValue); return; @@ -1127,9 +1123,6 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp case EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE: setReturnUpdate(RETURN_UPDATE_EDEFAULT); return; - case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE: - setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); - return; case EclipseLinkOrmPackage.XML_BASIC__INDEX: setIndex((XmlIndex_2_2)null); return; @@ -1142,6 +1135,9 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp case EclipseLinkOrmPackage.XML_BASIC__PROPERTIES: getProperties().clear(); return; + case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE: + setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); + return; case EclipseLinkOrmPackage.XML_BASIC__MUTABLE: setMutable(MUTABLE_EDEFAULT); return; @@ -1184,8 +1180,6 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp return returnInsert != null; case EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE: return RETURN_UPDATE_EDEFAULT == null ? returnUpdate != null : !RETURN_UPDATE_EDEFAULT.equals(returnUpdate); - case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE: - return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_BASIC__INDEX: return index != null; case EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX: @@ -1194,6 +1188,8 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp return accessMethods != null; case EclipseLinkOrmPackage.XML_BASIC__PROPERTIES: return properties != null && !properties.isEmpty(); + case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE: + return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_BASIC__MUTABLE: return MUTABLE_EDEFAULT == null ? mutable != null : !MUTABLE_EDEFAULT.equals(mutable); case EclipseLinkOrmPackage.XML_BASIC__CONVERT: @@ -1241,7 +1237,6 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp { case EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT: return EclipseLinkOrmV2_1Package.XML_BASIC_21__RETURN_INSERT; case EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE: return EclipseLinkOrmV2_1Package.XML_BASIC_21__RETURN_UPDATE; - case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_BASIC_21__ATTRIBUTE_TYPE; default: return -1; } } @@ -1281,6 +1276,7 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -1345,7 +1341,6 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp { case EclipseLinkOrmV2_1Package.XML_BASIC_21__RETURN_INSERT: return EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT; case EclipseLinkOrmV2_1Package.XML_BASIC_21__RETURN_UPDATE: return EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE; - case EclipseLinkOrmV2_1Package.XML_BASIC_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE; default: return -1; } } @@ -1385,6 +1380,7 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE; default: return -1; } } @@ -1448,7 +1444,11 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp public TextRange getConvertTextRange() { return getElementTextRange(EclipseLink.CONVERT); } - + + public TextRange getAttributeTypeTextRange() { + return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE); + } + // ********** translators ********** public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) { @@ -1548,7 +1548,7 @@ public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic imp } protected static Translator buildAttributeTypeTranslator() { - return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlBasic_2_1_AttributeType(), Translator.DOM_ATTRIBUTE); + return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE); } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicCollection.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicCollection.java index 296044bb42..a7cc8a8985 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicCollection.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicCollection.java @@ -21,8 +21,10 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator; +import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping; import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2; import org.eclipse.wst.common.internal.emf.resource.Translator; @@ -67,6 +69,26 @@ public class XmlBasicCollection extends AbstractXmlAttributeMapping implements X protected EList<XmlProperty> properties; /** + * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; + + /** * The default value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -191,6 +213,41 @@ public class XmlBasicCollection extends AbstractXmlAttributeMapping implements X } /** + * Returns the value of the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Attribute Type</em>' attribute. + * @see #setAttributeType(String) + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * @generated + */ + public String getAttributeType() + { + return attributeType; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection#getAttributeType <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Attribute Type</em>' attribute. + * @see #getAttributeType() + * @generated + */ + public void setAttributeType(String newAttributeType) + { + String oldAttributeType = attributeType; + attributeType = newAttributeType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ATTRIBUTE_TYPE, oldAttributeType, attributeType)); + } + + /** * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute. * <!-- begin-user-doc --> * <p> @@ -225,10 +282,6 @@ public class XmlBasicCollection extends AbstractXmlAttributeMapping implements X eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE, oldCascadeOnDelete, cascadeOnDelete)); } - public String getTypeName() { - return null; //basic-collection is deprecated, not attribute-type - } - /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -261,6 +314,8 @@ public class XmlBasicCollection extends AbstractXmlAttributeMapping implements X return getAccessMethods(); case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES: return getProperties(); + case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ATTRIBUTE_TYPE: + return getAttributeType(); case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE: return getCascadeOnDelete(); } @@ -285,6 +340,9 @@ public class XmlBasicCollection extends AbstractXmlAttributeMapping implements X getProperties().clear(); getProperties().addAll((Collection<? extends XmlProperty>)newValue); return; + case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ATTRIBUTE_TYPE: + setAttributeType((String)newValue); + return; case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE: setCascadeOnDelete((Boolean)newValue); return; @@ -308,6 +366,9 @@ public class XmlBasicCollection extends AbstractXmlAttributeMapping implements X case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES: getProperties().clear(); return; + case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ATTRIBUTE_TYPE: + setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); + return; case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE: setCascadeOnDelete(CASCADE_ON_DELETE_EDEFAULT); return; @@ -329,6 +390,8 @@ public class XmlBasicCollection extends AbstractXmlAttributeMapping implements X return accessMethods != null; case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES: return properties != null && !properties.isEmpty(); + case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ATTRIBUTE_TYPE: + return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE: return CASCADE_ON_DELETE_EDEFAULT == null ? cascadeOnDelete != null : !CASCADE_ON_DELETE_EDEFAULT.equals(cascadeOnDelete); } @@ -363,6 +426,7 @@ public class XmlBasicCollection extends AbstractXmlAttributeMapping implements X { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -405,6 +469,7 @@ public class XmlBasicCollection extends AbstractXmlAttributeMapping implements X { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ATTRIBUTE_TYPE; default: return -1; } } @@ -430,7 +495,9 @@ public class XmlBasicCollection extends AbstractXmlAttributeMapping implements X if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); - result.append(" (cascadeOnDelete: "); + result.append(" (attributeType: "); + result.append(attributeType); + result.append(", cascadeOnDelete: "); result.append(cascadeOnDelete); result.append(')'); return result.toString(); @@ -439,6 +506,10 @@ public class XmlBasicCollection extends AbstractXmlAttributeMapping implements X public String getMappingKey() { return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY; } + + public TextRange getAttributeTypeTextRange() { + return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE); + } // ********** translators ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicMap.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicMap.java index 4a50bf3655..be9106165b 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicMap.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicMap.java @@ -21,8 +21,10 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator; +import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping; import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2; import org.eclipse.wst.common.internal.emf.resource.Translator; @@ -67,6 +69,26 @@ public class XmlBasicMap extends AbstractXmlAttributeMapping implements XmlAttri protected EList<XmlProperty> properties; /** + * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; + + /** * The default value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -191,6 +213,41 @@ public class XmlBasicMap extends AbstractXmlAttributeMapping implements XmlAttri } /** + * Returns the value of the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Attribute Type</em>' attribute. + * @see #setAttributeType(String) + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * @generated + */ + public String getAttributeType() + { + return attributeType; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap#getAttributeType <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Attribute Type</em>' attribute. + * @see #getAttributeType() + * @generated + */ + public void setAttributeType(String newAttributeType) + { + String oldAttributeType = attributeType; + attributeType = newAttributeType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_MAP__ATTRIBUTE_TYPE, oldAttributeType, attributeType)); + } + + /** * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute. * <!-- begin-user-doc --> * <p> @@ -225,10 +282,6 @@ public class XmlBasicMap extends AbstractXmlAttributeMapping implements XmlAttri eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE, oldCascadeOnDelete, cascadeOnDelete)); } - public String getTypeName() { - return null; //basic-map is deprecated, no attribute-type - } - /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -261,6 +314,8 @@ public class XmlBasicMap extends AbstractXmlAttributeMapping implements XmlAttri return getAccessMethods(); case EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES: return getProperties(); + case EclipseLinkOrmPackage.XML_BASIC_MAP__ATTRIBUTE_TYPE: + return getAttributeType(); case EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE: return getCascadeOnDelete(); } @@ -285,6 +340,9 @@ public class XmlBasicMap extends AbstractXmlAttributeMapping implements XmlAttri getProperties().clear(); getProperties().addAll((Collection<? extends XmlProperty>)newValue); return; + case EclipseLinkOrmPackage.XML_BASIC_MAP__ATTRIBUTE_TYPE: + setAttributeType((String)newValue); + return; case EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE: setCascadeOnDelete((Boolean)newValue); return; @@ -308,6 +366,9 @@ public class XmlBasicMap extends AbstractXmlAttributeMapping implements XmlAttri case EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES: getProperties().clear(); return; + case EclipseLinkOrmPackage.XML_BASIC_MAP__ATTRIBUTE_TYPE: + setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); + return; case EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE: setCascadeOnDelete(CASCADE_ON_DELETE_EDEFAULT); return; @@ -329,6 +390,8 @@ public class XmlBasicMap extends AbstractXmlAttributeMapping implements XmlAttri return accessMethods != null; case EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES: return properties != null && !properties.isEmpty(); + case EclipseLinkOrmPackage.XML_BASIC_MAP__ATTRIBUTE_TYPE: + return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE: return CASCADE_ON_DELETE_EDEFAULT == null ? cascadeOnDelete != null : !CASCADE_ON_DELETE_EDEFAULT.equals(cascadeOnDelete); } @@ -363,6 +426,7 @@ public class XmlBasicMap extends AbstractXmlAttributeMapping implements XmlAttri { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_BASIC_MAP__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -405,6 +469,7 @@ public class XmlBasicMap extends AbstractXmlAttributeMapping implements XmlAttri { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_BASIC_MAP__ATTRIBUTE_TYPE; default: return -1; } } @@ -430,7 +495,9 @@ public class XmlBasicMap extends AbstractXmlAttributeMapping implements XmlAttri if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); - result.append(" (cascadeOnDelete: "); + result.append(" (attributeType: "); + result.append(attributeType); + result.append(", cascadeOnDelete: "); result.append(cascadeOnDelete); result.append(')'); return result.toString(); @@ -439,6 +506,10 @@ public class XmlBasicMap extends AbstractXmlAttributeMapping implements XmlAttri public String getMappingKey() { return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY; } + + public TextRange getAttributeTypeTextRange() { + return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE); + } // ********** translators ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlElementCollection.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlElementCollection.java index f7825319b0..aa787f02cb 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlElementCollection.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlElementCollection.java @@ -37,7 +37,6 @@ import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMappi import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1; -import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package; @@ -101,6 +100,26 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. protected EList<XmlProperty> properties; /** + * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; + + /** * The default value of the '{@link #getConvert() <em>Convert</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -217,26 +236,6 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. protected XmlBatchFetch batchFetch; /** - * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getAttributeType() - * @generated - * @ordered - */ - protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getAttributeType() - * @generated - * @ordered - */ - protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; - - /** * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -721,7 +720,7 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. * <!-- end-user-doc --> * @return the value of the '<em>Attribute Type</em>' attribute. * @see #setAttributeType(String) - * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection_2_1_AttributeType() + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ @@ -1401,10 +1400,6 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__DELETE_ALL, oldDeleteAll, deleteAll)); } - public String getTypeName() { - return this.getAttributeType(); - } - /** * Returns the value of the '<em><b>Converters</b></em>' containment reference list. * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}. @@ -1557,6 +1552,8 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. return getAccessMethods(); case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES: return getProperties(); + case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE: + return getAttributeType(); case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT: return getConvert(); case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES: @@ -1575,8 +1572,6 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. return getJoinFetch(); case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH: return getBatchFetch(); - case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE: - return getAttributeType(); case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING: return getPartitioning(); case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING: @@ -1625,6 +1620,9 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. getProperties().clear(); getProperties().addAll((Collection<? extends XmlProperty>)newValue); return; + case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE: + setAttributeType((String)newValue); + return; case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT: setConvert((String)newValue); return; @@ -1657,9 +1655,6 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH: setBatchFetch((XmlBatchFetch)newValue); return; - case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE: - setAttributeType((String)newValue); - return; case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING: setPartitioning((XmlPartitioning_2_2)newValue); return; @@ -1719,6 +1714,9 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES: getProperties().clear(); return; + case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE: + setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); + return; case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT: setConvert(CONVERT_EDEFAULT); return; @@ -1746,9 +1744,6 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH: setBatchFetch((XmlBatchFetch)null); return; - case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE: - setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); - return; case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING: setPartitioning((XmlPartitioning_2_2)null); return; @@ -1806,6 +1801,8 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. return accessMethods != null; case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES: return properties != null && !properties.isEmpty(); + case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE: + return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT: return CONVERT_EDEFAULT == null ? convert != null : !CONVERT_EDEFAULT.equals(convert); case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES: @@ -1824,8 +1821,6 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. return joinFetch != JOIN_FETCH_EDEFAULT; case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH: return batchFetch != null; - case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE: - return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING: return partitioning != null; case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING: @@ -1884,6 +1879,7 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -1949,7 +1945,6 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. { switch (derivedFeatureID) { - case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_ELEMENT_COLLECTION_21__ATTRIBUTE_TYPE; default: return -1; } } @@ -2025,6 +2020,7 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE; default: return -1; } } @@ -2090,7 +2086,6 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. { switch (baseFeatureID) { - case EclipseLinkOrmV2_1Package.XML_ELEMENT_COLLECTION_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE; default: return -1; } } @@ -2149,14 +2144,14 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); - result.append(" (convert: "); + result.append(" (attributeType: "); + result.append(attributeType); + result.append(", convert: "); result.append(convert); result.append(", mapKeyConvert: "); result.append(mapKeyConvert); result.append(", joinFetch: "); result.append(joinFetch); - result.append(", attributeType: "); - result.append(attributeType); result.append(", partitioned: "); result.append(partitioned); result.append(", cascadeOnDelete: "); @@ -2196,6 +2191,10 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. public TextRange getJoinFetchTextRange() { return getElementTextRange(EclipseLink.JOIN_FETCH); } + + public TextRange getAttributeTypeTextRange() { + return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE); + } // ********** translators ********** @@ -2278,7 +2277,7 @@ public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm. } protected static Translator buildAttributeTypeTranslator() { - return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlElementCollection_2_1_AttributeType(), Translator.DOM_ATTRIBUTE); + return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE); } protected static Translator buildJoinFetchTranslator() { diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbedded.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbedded.java index 70b783275e..0ef29e7403 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbedded.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbedded.java @@ -22,8 +22,8 @@ import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package; -import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbedded_2_1; import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator; +import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.wst.common.internal.emf.resource.Translator; /** @@ -45,47 +45,47 @@ import org.eclipse.wst.common.internal.emf.resource.Translator; * @model kind="class" * @generated */ -public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedded implements XmlEmbedded_2_1, XmlAttributeMapping +public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedded implements XmlAttributeMapping { /** - * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getAttributeType() + * @see #getAccessMethods() * @generated * @ordered */ - protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; + protected XmlAccessMethods accessMethods; /** - * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getAttributeType() + * @see #getProperties() * @generated * @ordered */ - protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; + protected EList<XmlProperty> properties; /** - * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference. + * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getAccessMethods() + * @see #getAttributeType() * @generated * @ordered */ - protected XmlAccessMethods accessMethods; + protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; /** - * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list. + * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getProperties() + * @see #getAttributeType() * @generated * @ordered */ - protected EList<XmlProperty> properties; + protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; /** * <!-- begin-user-doc --> @@ -118,7 +118,7 @@ public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedd * <!-- end-user-doc --> * @return the value of the '<em>Attribute Type</em>' attribute. * @see #setAttributeType(String) - * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbedded_2_1_AttributeType() + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ @@ -226,10 +226,6 @@ public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedd return properties; } - public String getTypeName() { - return this.getAttributeType(); - } - /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -258,12 +254,12 @@ public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedd { switch (featureID) { - case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE: - return getAttributeType(); case EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS: return getAccessMethods(); case EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES: return getProperties(); + case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE: + return getAttributeType(); } return super.eGet(featureID, resolve, coreType); } @@ -279,9 +275,6 @@ public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedd { switch (featureID) { - case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE: - setAttributeType((String)newValue); - return; case EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS: setAccessMethods((XmlAccessMethods)newValue); return; @@ -289,6 +282,9 @@ public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedd getProperties().clear(); getProperties().addAll((Collection<? extends XmlProperty>)newValue); return; + case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE: + setAttributeType((String)newValue); + return; } super.eSet(featureID, newValue); } @@ -303,15 +299,15 @@ public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedd { switch (featureID) { - case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE: - setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); - return; case EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS: setAccessMethods((XmlAccessMethods)null); return; case EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES: getProperties().clear(); return; + case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE: + setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); + return; } super.eUnset(featureID); } @@ -326,12 +322,12 @@ public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedd { switch (featureID) { - case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE: - return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS: return accessMethods != null; case EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES: return properties != null && !properties.isEmpty(); + case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE: + return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); } return super.eIsSet(featureID); } @@ -344,14 +340,6 @@ public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedd @Override public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { - if (baseClass == XmlEmbedded_2_1.class) - { - switch (derivedFeatureID) - { - case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_EMBEDDED_21__ATTRIBUTE_TYPE; - default: return -1; - } - } if (baseClass == XmlAccessMethodsHolder.class) { switch (derivedFeatureID) @@ -372,6 +360,7 @@ public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedd { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -386,14 +375,6 @@ public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedd @Override public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { - if (baseClass == XmlEmbedded_2_1.class) - { - switch (baseFeatureID) - { - case EclipseLinkOrmV2_1Package.XML_EMBEDDED_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE; - default: return -1; - } - } if (baseClass == XmlAccessMethodsHolder.class) { switch (baseFeatureID) @@ -414,6 +395,7 @@ public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedd { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE; default: return -1; } } @@ -437,6 +419,10 @@ public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedd return result.toString(); } + public TextRange getAttributeTypeTextRange() { + return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE); + } + // ********** translators ********** public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) { @@ -468,7 +454,7 @@ public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedd } protected static Translator buildAttributeTypeTranslator() { - return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlEmbedded_2_1_AttributeType(), Translator.DOM_ATTRIBUTE); + return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE); } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddedId.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddedId.java index 9917b45e68..ecc164cf96 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddedId.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddedId.java @@ -22,8 +22,8 @@ import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package; -import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEmbeddedId_2_1; import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator; +import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.wst.common.internal.emf.resource.Translator; /** @@ -45,47 +45,47 @@ import org.eclipse.wst.common.internal.emf.resource.Translator; * @model kind="class" * @generated */ -public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddedId implements XmlEmbeddedId_2_1, XmlAttributeMapping +public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddedId implements XmlAttributeMapping { /** - * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getAttributeType() + * @see #getAccessMethods() * @generated * @ordered */ - protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; + protected XmlAccessMethods accessMethods; /** - * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getAttributeType() + * @see #getProperties() * @generated * @ordered */ - protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; + protected EList<XmlProperty> properties; /** - * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference. + * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getAccessMethods() + * @see #getAttributeType() * @generated * @ordered */ - protected XmlAccessMethods accessMethods; + protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; /** - * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list. + * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getProperties() + * @see #getAttributeType() * @generated * @ordered */ - protected EList<XmlProperty> properties; + protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; /** * <!-- begin-user-doc --> @@ -118,7 +118,7 @@ public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbe * <!-- end-user-doc --> * @return the value of the '<em>Attribute Type</em>' attribute. * @see #setAttributeType(String) - * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddedId_2_1_AttributeType() + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ @@ -226,10 +226,6 @@ public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbe return properties; } - public String getTypeName() { - return this.getAttributeType(); - } - /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -258,12 +254,12 @@ public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbe { switch (featureID) { - case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE: - return getAttributeType(); case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS: return getAccessMethods(); case EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES: return getProperties(); + case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE: + return getAttributeType(); } return super.eGet(featureID, resolve, coreType); } @@ -279,9 +275,6 @@ public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbe { switch (featureID) { - case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE: - setAttributeType((String)newValue); - return; case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS: setAccessMethods((XmlAccessMethods)newValue); return; @@ -289,6 +282,9 @@ public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbe getProperties().clear(); getProperties().addAll((Collection<? extends XmlProperty>)newValue); return; + case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE: + setAttributeType((String)newValue); + return; } super.eSet(featureID, newValue); } @@ -303,15 +299,15 @@ public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbe { switch (featureID) { - case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE: - setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); - return; case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS: setAccessMethods((XmlAccessMethods)null); return; case EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES: getProperties().clear(); return; + case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE: + setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); + return; } super.eUnset(featureID); } @@ -326,12 +322,12 @@ public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbe { switch (featureID) { - case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE: - return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS: return accessMethods != null; case EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES: return properties != null && !properties.isEmpty(); + case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE: + return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); } return super.eIsSet(featureID); } @@ -344,14 +340,6 @@ public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbe @Override public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { - if (baseClass == XmlEmbeddedId_2_1.class) - { - switch (derivedFeatureID) - { - case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_EMBEDDED_ID_21__ATTRIBUTE_TYPE; - default: return -1; - } - } if (baseClass == XmlAccessMethodsHolder.class) { switch (derivedFeatureID) @@ -372,6 +360,7 @@ public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbe { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -386,14 +375,6 @@ public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbe @Override public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { - if (baseClass == XmlEmbeddedId_2_1.class) - { - switch (baseFeatureID) - { - case EclipseLinkOrmV2_1Package.XML_EMBEDDED_ID_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE; - default: return -1; - } - } if (baseClass == XmlAccessMethodsHolder.class) { switch (baseFeatureID) @@ -414,6 +395,7 @@ public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbe { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE; default: return -1; } } @@ -437,6 +419,11 @@ public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbe return result.toString(); } + + public TextRange getAttributeTypeTextRange() { + return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE); + } + // ********** translators ********** public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) { @@ -467,7 +454,7 @@ public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbe } protected static Translator buildAttributeTypeTranslator() { - return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlEmbeddedId_2_1_AttributeType(), Translator.DOM_ATTRIBUTE); + return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE); } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlId.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlId.java index 3683d8422d..c6a89571b8 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlId.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlId.java @@ -24,7 +24,6 @@ import org.eclipse.jpt.jpa.core.resource.orm.JPA; import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package; -import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlId_2_1; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2; @@ -58,67 +57,67 @@ import org.eclipse.wst.common.internal.emf.resource.Translator; * @model kind="class" * @generated */ -public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implements XmlId_2_1, XmlId_2_2, XmlId_2_4, XmlAttributeMapping, XmlMutable, XmlConvertibleMapping, XmlConverterContainer +public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implements XmlId_2_2, XmlId_2_4, XmlAttributeMapping, XmlMutable, XmlConvertibleMapping, XmlConverterContainer { /** - * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * The cached value of the '{@link #getIndex() <em>Index</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getAttributeType() + * @see #getIndex() * @generated * @ordered */ - protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; + protected XmlIndex_2_2 index; /** - * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * The cached value of the '{@link #getCacheIndex() <em>Cache Index</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getAttributeType() + * @see #getCacheIndex() * @generated * @ordered */ - protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; + protected XmlCacheIndex_2_4 cacheIndex; /** - * The cached value of the '{@link #getIndex() <em>Index</em>}' containment reference. + * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getIndex() + * @see #getAccessMethods() * @generated * @ordered */ - protected XmlIndex_2_2 index; + protected XmlAccessMethods accessMethods; /** - * The cached value of the '{@link #getCacheIndex() <em>Cache Index</em>}' containment reference. + * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getCacheIndex() + * @see #getProperties() * @generated * @ordered */ - protected XmlCacheIndex_2_4 cacheIndex; + protected EList<XmlProperty> properties; /** - * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference. + * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getAccessMethods() + * @see #getAttributeType() * @generated * @ordered */ - protected XmlAccessMethods accessMethods; + protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; /** - * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list. + * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getProperties() + * @see #getAttributeType() * @generated * @ordered */ - protected EList<XmlProperty> properties; + protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; /** * The default value of the '{@link #getMutable() <em>Mutable</em>}' attribute. @@ -231,7 +230,7 @@ public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implement * <!-- end-user-doc --> * @return the value of the '<em>Attribute Type</em>' attribute. * @see #setAttributeType(String) - * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlId_2_1_AttributeType() + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ @@ -538,10 +537,6 @@ public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implement return structConverters; } - public String getTypeName() { - return this.getAttributeType(); - } - /** * Returns the value of the '<em><b>Access Methods</b></em>' containment reference. * <!-- begin-user-doc --> @@ -665,8 +660,6 @@ public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implement { switch (featureID) { - case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE: - return getAttributeType(); case EclipseLinkOrmPackage.XML_ID__INDEX: return getIndex(); case EclipseLinkOrmPackage.XML_ID__CACHE_INDEX: @@ -675,6 +668,8 @@ public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implement return getAccessMethods(); case EclipseLinkOrmPackage.XML_ID__PROPERTIES: return getProperties(); + case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE: + return getAttributeType(); case EclipseLinkOrmPackage.XML_ID__MUTABLE: return getMutable(); case EclipseLinkOrmPackage.XML_ID__CONVERT: @@ -702,9 +697,6 @@ public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implement { switch (featureID) { - case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE: - setAttributeType((String)newValue); - return; case EclipseLinkOrmPackage.XML_ID__INDEX: setIndex((XmlIndex_2_2)newValue); return; @@ -718,6 +710,9 @@ public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implement getProperties().clear(); getProperties().addAll((Collection<? extends XmlProperty>)newValue); return; + case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE: + setAttributeType((String)newValue); + return; case EclipseLinkOrmPackage.XML_ID__MUTABLE: setMutable((Boolean)newValue); return; @@ -754,9 +749,6 @@ public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implement { switch (featureID) { - case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE: - setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); - return; case EclipseLinkOrmPackage.XML_ID__INDEX: setIndex((XmlIndex_2_2)null); return; @@ -769,6 +761,9 @@ public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implement case EclipseLinkOrmPackage.XML_ID__PROPERTIES: getProperties().clear(); return; + case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE: + setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); + return; case EclipseLinkOrmPackage.XML_ID__MUTABLE: setMutable(MUTABLE_EDEFAULT); return; @@ -801,8 +796,6 @@ public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implement { switch (featureID) { - case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE: - return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_ID__INDEX: return index != null; case EclipseLinkOrmPackage.XML_ID__CACHE_INDEX: @@ -811,6 +804,8 @@ public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implement return accessMethods != null; case EclipseLinkOrmPackage.XML_ID__PROPERTIES: return properties != null && !properties.isEmpty(); + case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE: + return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_ID__MUTABLE: return MUTABLE_EDEFAULT == null ? mutable != null : !MUTABLE_EDEFAULT.equals(mutable); case EclipseLinkOrmPackage.XML_ID__CONVERT: @@ -835,14 +830,6 @@ public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implement @Override public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { - if (baseClass == XmlId_2_1.class) - { - switch (derivedFeatureID) - { - case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_ID_21__ATTRIBUTE_TYPE; - default: return -1; - } - } if (baseClass == XmlId_2_2.class) { switch (derivedFeatureID) @@ -879,6 +866,7 @@ public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implement { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -920,14 +908,6 @@ public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implement @Override public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { - if (baseClass == XmlId_2_1.class) - { - switch (baseFeatureID) - { - case EclipseLinkOrmV2_1Package.XML_ID_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE; - default: return -1; - } - } if (baseClass == XmlId_2_2.class) { switch (baseFeatureID) @@ -964,6 +944,7 @@ public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implement { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE; default: return -1; } } @@ -1025,7 +1006,11 @@ public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implement public TextRange getConvertTextRange() { return getElementTextRange(EclipseLink.CONVERT); } - + + public TextRange getAttributeTypeTextRange() { + return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE); + } + // ********** translators ********** @@ -1102,7 +1087,7 @@ public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implement } protected static Translator buildAttributeTypeTranslator() { - return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlId_2_1_AttributeType(), Translator.DOM_ATTRIBUTE); + return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE); } protected static Translator buildEnumeratedTranslator() { diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToMany.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToMany.java index 9abf544c82..08de9fb467 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToMany.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToMany.java @@ -36,7 +36,6 @@ import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMappi import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1; -import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package; @@ -156,26 +155,6 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany protected XmlBatchFetch batchFetch; /** - * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getAttributeType() - * @generated - * @ordered - */ - protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getAttributeType() - * @generated - * @ordered - */ - protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; - - /** * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -336,6 +315,26 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany protected EList<XmlProperty> properties; /** + * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; + + /** * changed this to null and removed the generated flag so emf won't generate over it * we don't want a default for enums, just null if the tag does not exist */ @@ -410,10 +409,6 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH, oldJoinFetch, joinFetch)); } - public String getTypeName() { - return this.getAttributeType(); - } - /** * Returns the value of the '<em><b>Map Key Association Overrides</b></em>' containment reference list. * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride}. @@ -634,7 +629,7 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany * <!-- end-user-doc --> * @return the value of the '<em>Attribute Type</em>' attribute. * @see #setAttributeType(String) - * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToMany_2_1_AttributeType() + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ @@ -1397,8 +1392,6 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany return getMapKeyConvert(); case EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH: return getBatchFetch(); - case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE: - return getAttributeType(); case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING: return getPartitioning(); case EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING: @@ -1425,6 +1418,8 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany return getAccessMethods(); case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES: return getProperties(); + case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE: + return getAttributeType(); case EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH: return getJoinFetch(); } @@ -1468,9 +1463,6 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany case EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH: setBatchFetch((XmlBatchFetch)newValue); return; - case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE: - setAttributeType((String)newValue); - return; case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING: setPartitioning((XmlPartitioning_2_2)newValue); return; @@ -1511,6 +1503,9 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany getProperties().clear(); getProperties().addAll((Collection<? extends XmlProperty>)newValue); return; + case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE: + setAttributeType((String)newValue); + return; case EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH: setJoinFetch((XmlJoinFetchType)newValue); return; @@ -1549,9 +1544,6 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany case EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH: setBatchFetch((XmlBatchFetch)null); return; - case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE: - setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); - return; case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING: setPartitioning((XmlPartitioning_2_2)null); return; @@ -1591,6 +1583,9 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES: getProperties().clear(); return; + case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE: + setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); + return; case EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH: setJoinFetch(JOIN_FETCH_EDEFAULT); return; @@ -1622,8 +1617,6 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany return MAP_KEY_CONVERT_EDEFAULT == null ? mapKeyConvert != null : !MAP_KEY_CONVERT_EDEFAULT.equals(mapKeyConvert); case EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH: return batchFetch != null; - case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE: - return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING: return partitioning != null; case EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING: @@ -1650,6 +1643,8 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany return accessMethods != null; case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES: return properties != null && !properties.isEmpty(); + case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE: + return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH: return joinFetch != JOIN_FETCH_EDEFAULT; } @@ -1710,7 +1705,6 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany { switch (derivedFeatureID) { - case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_MANY_TO_MANY_21__ATTRIBUTE_TYPE; default: return -1; } } @@ -1759,6 +1753,7 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -1827,7 +1822,6 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany { switch (baseFeatureID) { - case EclipseLinkOrmV2_1Package.XML_MANY_TO_MANY_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE; default: return -1; } } @@ -1876,6 +1870,7 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE; default: return -1; } } @@ -1903,14 +1898,14 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany StringBuffer result = new StringBuffer(super.toString()); result.append(" (mapKeyConvert: "); result.append(mapKeyConvert); - result.append(", attributeType: "); - result.append(attributeType); result.append(", partitioned: "); result.append(partitioned); result.append(", cascadeOnDelete: "); result.append(cascadeOnDelete); result.append(", nonCacheable: "); result.append(nonCacheable); + result.append(", attributeType: "); + result.append(attributeType); result.append(", joinFetch: "); result.append(joinFetch); result.append(')'); @@ -1920,6 +1915,10 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany public TextRange getJoinFetchTextRange() { return getElementTextRange(EclipseLink.JOIN_FETCH); } + + public TextRange getAttributeTypeTextRange() { + return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE); + } // ********** translators ********** @@ -2016,7 +2015,7 @@ public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlMany } protected static Translator buildAttributeTypeTranslator() { - return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlManyToMany_2_1_AttributeType(), Translator.DOM_ATTRIBUTE); + return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE); } protected static Translator buildBatchFetchTranslator() { diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToOne.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToOne.java index cafbd384be..e19ba013fc 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToOne.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToOne.java @@ -215,6 +215,26 @@ public class XmlManyToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlManyT protected EList<XmlProperty> properties; /** + * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; + + /** * changed this to null and removed the generated flag so emf won't generate over it * we don't want a default for enums, just null if the tag does not exist */ @@ -899,10 +919,6 @@ public class XmlManyToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlManyT eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH, oldJoinFetch, joinFetch)); } - public String getTypeName() { - return this.getTargetEntity(); - } - /** * Returns the value of the '<em><b>Access Methods</b></em>' containment reference. * <!-- begin-user-doc --> @@ -987,6 +1003,41 @@ public class XmlManyToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlManyT } /** + * Returns the value of the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Attribute Type</em>' attribute. + * @see #setAttributeType(String) + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * @generated + */ + public String getAttributeType() + { + return attributeType; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getAttributeType <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Attribute Type</em>' attribute. + * @see #getAttributeType() + * @generated + */ + public void setAttributeType(String newAttributeType) + { + String oldAttributeType = attributeType; + attributeType = newAttributeType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__ATTRIBUTE_TYPE, oldAttributeType, attributeType)); + } + + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -1058,6 +1109,8 @@ public class XmlManyToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlManyT return getAccessMethods(); case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES: return getProperties(); + case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ATTRIBUTE_TYPE: + return getAttributeType(); case EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH: return getJoinFetch(); } @@ -1115,6 +1168,9 @@ public class XmlManyToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlManyT getProperties().clear(); getProperties().addAll((Collection<? extends XmlProperty>)newValue); return; + case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ATTRIBUTE_TYPE: + setAttributeType((String)newValue); + return; case EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH: setJoinFetch((XmlJoinFetchType)newValue); return; @@ -1171,6 +1227,9 @@ public class XmlManyToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlManyT case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES: getProperties().clear(); return; + case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ATTRIBUTE_TYPE: + setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); + return; case EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH: setJoinFetch(JOIN_FETCH_EDEFAULT); return; @@ -1214,6 +1273,8 @@ public class XmlManyToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlManyT return accessMethods != null; case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES: return properties != null && !properties.isEmpty(); + case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ATTRIBUTE_TYPE: + return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH: return joinFetch != JOIN_FETCH_EDEFAULT; } @@ -1287,6 +1348,7 @@ public class XmlManyToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlManyT { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -1368,6 +1430,7 @@ public class XmlManyToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlManyT { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__ATTRIBUTE_TYPE; default: return -1; } } @@ -1397,6 +1460,8 @@ public class XmlManyToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlManyT result.append(partitioned); result.append(", nonCacheable: "); result.append(nonCacheable); + result.append(", attributeType: "); + result.append(attributeType); result.append(", joinFetch: "); result.append(joinFetch); result.append(')'); @@ -1406,6 +1471,11 @@ public class XmlManyToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlManyT public TextRange getJoinFetchTextRange() { return getElementTextRange(EclipseLink.JOIN_FETCH); } + + public TextRange getAttributeTypeTextRange() { + //no attribute-type for many-to-one + return getValidationTextRange(); + } // ********** translators ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToMany.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToMany.java index 88a49c4680..efd291dee1 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToMany.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToMany.java @@ -35,7 +35,6 @@ import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMappi import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1; -import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package; @@ -158,26 +157,6 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo protected XmlBatchFetch batchFetch; /** - * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getAttributeType() - * @generated - * @ordered - */ - protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. - * <!-- begin-user-doc --> - * <!-- end-user-doc --> - * @see #getAttributeType() - * @generated - * @ordered - */ - protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; - - /** * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -358,6 +337,26 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo protected EList<XmlProperty> properties; /** + * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; + + /** * The default value of the '{@link #isPrivateOwned() <em>Private Owned</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -487,10 +486,6 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH, oldJoinFetch, joinFetch)); } - public String getTypeName() { - return this.getAttributeType(); - } - /** * Returns the value of the '<em><b>Map Key Association Overrides</b></em>' containment reference list. * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride}. @@ -711,7 +706,7 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo * <!-- end-user-doc --> * @return the value of the '<em>Attribute Type</em>' attribute. * @see #setAttributeType(String) - * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany_2_1_AttributeType() + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ @@ -1509,8 +1504,6 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo return getMapKeyConvert(); case EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH: return getBatchFetch(); - case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE: - return getAttributeType(); case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING: return getPartitioning(); case EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING: @@ -1539,6 +1532,8 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo return getAccessMethods(); case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES: return getProperties(); + case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE: + return getAttributeType(); case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED: return isPrivateOwned(); case EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH: @@ -1584,9 +1579,6 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo case EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH: setBatchFetch((XmlBatchFetch)newValue); return; - case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE: - setAttributeType((String)newValue); - return; case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING: setPartitioning((XmlPartitioning_2_2)newValue); return; @@ -1630,6 +1622,9 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo getProperties().clear(); getProperties().addAll((Collection<? extends XmlProperty>)newValue); return; + case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE: + setAttributeType((String)newValue); + return; case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED: setPrivateOwned((Boolean)newValue); return; @@ -1671,9 +1666,6 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo case EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH: setBatchFetch((XmlBatchFetch)null); return; - case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE: - setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); - return; case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING: setPartitioning((XmlPartitioning_2_2)null); return; @@ -1716,6 +1708,9 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES: getProperties().clear(); return; + case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE: + setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); + return; case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED: setPrivateOwned(PRIVATE_OWNED_EDEFAULT); return; @@ -1750,8 +1745,6 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo return MAP_KEY_CONVERT_EDEFAULT == null ? mapKeyConvert != null : !MAP_KEY_CONVERT_EDEFAULT.equals(mapKeyConvert); case EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH: return batchFetch != null; - case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE: - return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING: return partitioning != null; case EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING: @@ -1780,6 +1773,8 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo return accessMethods != null; case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES: return properties != null && !properties.isEmpty(); + case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE: + return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED: return privateOwned != PRIVATE_OWNED_EDEFAULT; case EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH: @@ -1842,7 +1837,6 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo { switch (derivedFeatureID) { - case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_ONE_TO_MANY_21__ATTRIBUTE_TYPE; default: return -1; } } @@ -1899,6 +1893,7 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -1975,7 +1970,6 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo { switch (baseFeatureID) { - case EclipseLinkOrmV2_1Package.XML_ONE_TO_MANY_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE; default: return -1; } } @@ -2032,6 +2026,7 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE; default: return -1; } } @@ -2067,8 +2062,6 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo StringBuffer result = new StringBuffer(super.toString()); result.append(" (mapKeyConvert: "); result.append(mapKeyConvert); - result.append(", attributeType: "); - result.append(attributeType); result.append(", partitioned: "); result.append(partitioned); result.append(", cascadeOnDelete: "); @@ -2077,6 +2070,8 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo result.append(noncacheable); result.append(", deleteAll: "); result.append(deleteAll); + result.append(", attributeType: "); + result.append(attributeType); result.append(", privateOwned: "); result.append(privateOwned); result.append(", joinFetch: "); @@ -2092,6 +2087,10 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo public TextRange getJoinFetchTextRange() { return getElementTextRange(EclipseLink.JOIN_FETCH); } + + public TextRange getAttributeTypeTextRange() { + return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE); + } // ********** translators ********** @@ -2192,7 +2191,7 @@ public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneTo } protected static Translator buildAttributeTypeTranslator() { - return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlOneToMany_2_1_AttributeType(), Translator.DOM_ATTRIBUTE); + return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE); } protected static Translator buildBatchFetchTranslator() { diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToOne.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToOne.java index 970a36e8e5..33abefac2a 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToOne.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToOne.java @@ -236,6 +236,26 @@ public class XmlOneToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneToO protected EList<XmlProperty> properties; /** + * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; + + /** * The default value of the '{@link #isPrivateOwned() <em>Private Owned</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -1010,10 +1030,6 @@ public class XmlOneToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneToO eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH, oldJoinFetch, joinFetch)); } - public String getTypeName() { - return this.getTargetEntity(); - } - /** * Returns the value of the '<em><b>Access Methods</b></em>' containment reference. * <!-- begin-user-doc --> @@ -1098,6 +1114,41 @@ public class XmlOneToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneToO } /** + * Returns the value of the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Attribute Type</em>' attribute. + * @see #setAttributeType(String) + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * @generated + */ + public String getAttributeType() + { + return attributeType; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getAttributeType <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Attribute Type</em>' attribute. + * @see #getAttributeType() + * @generated + */ + public void setAttributeType(String newAttributeType) + { + String oldAttributeType = attributeType; + attributeType = newAttributeType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__ATTRIBUTE_TYPE, oldAttributeType, attributeType)); + } + + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -1171,6 +1222,8 @@ public class XmlOneToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneToO return getAccessMethods(); case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES: return getProperties(); + case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ATTRIBUTE_TYPE: + return getAttributeType(); case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED: return isPrivateOwned(); case EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH: @@ -1233,6 +1286,9 @@ public class XmlOneToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneToO getProperties().clear(); getProperties().addAll((Collection<? extends XmlProperty>)newValue); return; + case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ATTRIBUTE_TYPE: + setAttributeType((String)newValue); + return; case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED: setPrivateOwned((Boolean)newValue); return; @@ -1295,6 +1351,9 @@ public class XmlOneToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneToO case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES: getProperties().clear(); return; + case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ATTRIBUTE_TYPE: + setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); + return; case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED: setPrivateOwned(PRIVATE_OWNED_EDEFAULT); return; @@ -1343,6 +1402,8 @@ public class XmlOneToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneToO return accessMethods != null; case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES: return properties != null && !properties.isEmpty(); + case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ATTRIBUTE_TYPE: + return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED: return privateOwned != PRIVATE_OWNED_EDEFAULT; case EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH: @@ -1419,6 +1480,7 @@ public class XmlOneToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneToO { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -1509,6 +1571,7 @@ public class XmlOneToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneToO { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__ATTRIBUTE_TYPE; default: return -1; } } @@ -1548,6 +1611,8 @@ public class XmlOneToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneToO result.append(cascadeOnDelete); result.append(", nonCacheable: "); result.append(nonCacheable); + result.append(", attributeType: "); + result.append(attributeType); result.append(", privateOwned: "); result.append(privateOwned); result.append(", joinFetch: "); @@ -1563,6 +1628,11 @@ public class XmlOneToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneToO public TextRange getJoinFetchTextRange() { return getElementTextRange(EclipseLink.JOIN_FETCH); } + + public TextRange getAttributeTypeTextRange() { + //no attribute-type for one-to-one + return getValidationTextRange(); + } // ********** translators ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructure.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructure.java index 5d88d45205..bb7cf9a70c 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructure.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructure.java @@ -20,10 +20,11 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator; +import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping; import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3; -import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3; import org.eclipse.wst.common.internal.emf.resource.Translator; @@ -193,7 +194,7 @@ public class XmlStructure extends AbstractXmlAttributeMapping implements XmlAttr * <!-- end-user-doc --> * @return the value of the '<em>Attribute Type</em>' attribute. * @see #setAttributeType(String) - * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructure_2_3_AttributeType() + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ @@ -218,10 +219,6 @@ public class XmlStructure extends AbstractXmlAttributeMapping implements XmlAttr eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STRUCTURE__ATTRIBUTE_TYPE, oldAttributeType, attributeType)); } - public String getTypeName() { - return this.getAttributeType(); - } - /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -356,6 +353,7 @@ public class XmlStructure extends AbstractXmlAttributeMapping implements XmlAttr { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_STRUCTURE__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -363,7 +361,6 @@ public class XmlStructure extends AbstractXmlAttributeMapping implements XmlAttr { switch (derivedFeatureID) { - case EclipseLinkOrmPackage.XML_STRUCTURE__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_3Package.XML_STRUCTURE_23__ATTRIBUTE_TYPE; default: return -1; } } @@ -398,6 +395,7 @@ public class XmlStructure extends AbstractXmlAttributeMapping implements XmlAttr { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_STRUCTURE__ATTRIBUTE_TYPE; default: return -1; } } @@ -405,7 +403,6 @@ public class XmlStructure extends AbstractXmlAttributeMapping implements XmlAttr { switch (baseFeatureID) { - case EclipseLinkOrmV2_3Package.XML_STRUCTURE_23__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_STRUCTURE__ATTRIBUTE_TYPE; default: return -1; } } @@ -433,6 +430,10 @@ public class XmlStructure extends AbstractXmlAttributeMapping implements XmlAttr return EclipseLinkMappingKeys.STRUCTURE_ATTRIBUTE_MAPPING_KEY; } + public TextRange getAttributeTypeTextRange() { + return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE); + } + // ********** translators ********** public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) { @@ -454,7 +455,7 @@ public class XmlStructure extends AbstractXmlAttributeMapping implements XmlAttr } protected static Translator buildAttributeTypeTranslator() { - return new Translator(EclipseLink2_3.STRUCTURE__ATTRIBUTE_TYPE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlStructure_2_3_AttributeType(), Translator.DOM_ATTRIBUTE); + return new Translator(EclipseLink2_3.STRUCTURE__ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE); } protected static Translator buildPropertyTranslator() { diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransformation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransformation.java index c6b24670f1..ab377138a5 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransformation.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransformation.java @@ -21,11 +21,10 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator; +import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping; import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1; -import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package; -import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTransformation_2_1; import org.eclipse.wst.common.internal.emf.resource.Translator; /** @@ -45,47 +44,47 @@ import org.eclipse.wst.common.internal.emf.resource.Translator; * @model kind="class" * @generated */ -public class XmlTransformation extends AbstractXmlAttributeMapping implements XmlTransformation_2_1, XmlAttributeMapping +public class XmlTransformation extends AbstractXmlAttributeMapping implements XmlAttributeMapping { /** - * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getAttributeType() + * @see #getAccessMethods() * @generated * @ordered */ - protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; + protected XmlAccessMethods accessMethods; /** - * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getAttributeType() + * @see #getProperties() * @generated * @ordered */ - protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; + protected EList<XmlProperty> properties; /** - * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference. + * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getAccessMethods() + * @see #getAttributeType() * @generated * @ordered */ - protected XmlAccessMethods accessMethods; + protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; /** - * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list. + * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getProperties() + * @see #getAttributeType() * @generated * @ordered */ - protected EList<XmlProperty> properties; + protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; /** * <!-- begin-user-doc --> @@ -118,7 +117,7 @@ public class XmlTransformation extends AbstractXmlAttributeMapping implements Xm * <!-- end-user-doc --> * @return the value of the '<em>Attribute Type</em>' attribute. * @see #setAttributeType(String) - * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformation_2_1_AttributeType() + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ @@ -226,10 +225,6 @@ public class XmlTransformation extends AbstractXmlAttributeMapping implements Xm return properties; } - public String getTypeName() { - return this.getAttributeType(); - } - /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -258,12 +253,12 @@ public class XmlTransformation extends AbstractXmlAttributeMapping implements Xm { switch (featureID) { - case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE: - return getAttributeType(); case EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS: return getAccessMethods(); case EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES: return getProperties(); + case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE: + return getAttributeType(); } return super.eGet(featureID, resolve, coreType); } @@ -279,9 +274,6 @@ public class XmlTransformation extends AbstractXmlAttributeMapping implements Xm { switch (featureID) { - case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE: - setAttributeType((String)newValue); - return; case EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS: setAccessMethods((XmlAccessMethods)newValue); return; @@ -289,6 +281,9 @@ public class XmlTransformation extends AbstractXmlAttributeMapping implements Xm getProperties().clear(); getProperties().addAll((Collection<? extends XmlProperty>)newValue); return; + case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE: + setAttributeType((String)newValue); + return; } super.eSet(featureID, newValue); } @@ -303,15 +298,15 @@ public class XmlTransformation extends AbstractXmlAttributeMapping implements Xm { switch (featureID) { - case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE: - setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); - return; case EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS: setAccessMethods((XmlAccessMethods)null); return; case EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES: getProperties().clear(); return; + case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE: + setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); + return; } super.eUnset(featureID); } @@ -326,12 +321,12 @@ public class XmlTransformation extends AbstractXmlAttributeMapping implements Xm { switch (featureID) { - case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE: - return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS: return accessMethods != null; case EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES: return properties != null && !properties.isEmpty(); + case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE: + return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); } return super.eIsSet(featureID); } @@ -344,14 +339,6 @@ public class XmlTransformation extends AbstractXmlAttributeMapping implements Xm @Override public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { - if (baseClass == XmlTransformation_2_1.class) - { - switch (derivedFeatureID) - { - case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_TRANSFORMATION_21__ATTRIBUTE_TYPE; - default: return -1; - } - } if (baseClass == XmlAccessMethodsHolder.class) { switch (derivedFeatureID) @@ -372,6 +359,7 @@ public class XmlTransformation extends AbstractXmlAttributeMapping implements Xm { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -386,14 +374,6 @@ public class XmlTransformation extends AbstractXmlAttributeMapping implements Xm @Override public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { - if (baseClass == XmlTransformation_2_1.class) - { - switch (baseFeatureID) - { - case EclipseLinkOrmV2_1Package.XML_TRANSFORMATION_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE; - default: return -1; - } - } if (baseClass == XmlAccessMethodsHolder.class) { switch (baseFeatureID) @@ -414,6 +394,7 @@ public class XmlTransformation extends AbstractXmlAttributeMapping implements Xm { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE; default: return -1; } } @@ -440,6 +421,10 @@ public class XmlTransformation extends AbstractXmlAttributeMapping implements Xm public String getMappingKey() { return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY; } + + public TextRange getAttributeTypeTextRange() { + return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE); + } // ********** translators ********** @@ -472,7 +457,7 @@ public class XmlTransformation extends AbstractXmlAttributeMapping implements Xm } protected static Translator buildAttributeTypeTranslator() { - return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlTransformation_2_1_AttributeType(), Translator.DOM_ATTRIBUTE); + return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE); } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransient.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransient.java index 6a5cb132bf..7cb7a55e27 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransient.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransient.java @@ -22,6 +22,7 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator; +import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.wst.common.internal.emf.resource.Translator; /** @@ -57,6 +58,26 @@ public class XmlTransient extends org.eclipse.jpt.jpa.core.resource.orm.XmlTrans protected EList<XmlProperty> properties; /** + * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; + + /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated @@ -160,8 +181,39 @@ public class XmlTransient extends org.eclipse.jpt.jpa.core.resource.orm.XmlTrans return properties; } - public String getTypeName() { - return null; + /** + * Returns the value of the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Attribute Type</em>' attribute. + * @see #setAttributeType(String) + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * @generated + */ + public String getAttributeType() + { + return attributeType; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransient#getAttributeType <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Attribute Type</em>' attribute. + * @see #getAttributeType() + * @generated + */ + public void setAttributeType(String newAttributeType) + { + String oldAttributeType = attributeType; + attributeType = newAttributeType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TRANSIENT__ATTRIBUTE_TYPE, oldAttributeType, attributeType)); } /** @@ -196,6 +248,8 @@ public class XmlTransient extends org.eclipse.jpt.jpa.core.resource.orm.XmlTrans return getAccessMethods(); case EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES: return getProperties(); + case EclipseLinkOrmPackage.XML_TRANSIENT__ATTRIBUTE_TYPE: + return getAttributeType(); } return super.eGet(featureID, resolve, coreType); } @@ -218,6 +272,9 @@ public class XmlTransient extends org.eclipse.jpt.jpa.core.resource.orm.XmlTrans getProperties().clear(); getProperties().addAll((Collection<? extends XmlProperty>)newValue); return; + case EclipseLinkOrmPackage.XML_TRANSIENT__ATTRIBUTE_TYPE: + setAttributeType((String)newValue); + return; } super.eSet(featureID, newValue); } @@ -238,6 +295,9 @@ public class XmlTransient extends org.eclipse.jpt.jpa.core.resource.orm.XmlTrans case EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES: getProperties().clear(); return; + case EclipseLinkOrmPackage.XML_TRANSIENT__ATTRIBUTE_TYPE: + setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); + return; } super.eUnset(featureID); } @@ -256,6 +316,8 @@ public class XmlTransient extends org.eclipse.jpt.jpa.core.resource.orm.XmlTrans return accessMethods != null; case EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES: return properties != null && !properties.isEmpty(); + case EclipseLinkOrmPackage.XML_TRANSIENT__ATTRIBUTE_TYPE: + return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); } return super.eIsSet(featureID); } @@ -288,6 +350,7 @@ public class XmlTransient extends org.eclipse.jpt.jpa.core.resource.orm.XmlTrans { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_TRANSIENT__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -322,6 +385,7 @@ public class XmlTransient extends org.eclipse.jpt.jpa.core.resource.orm.XmlTrans { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_TRANSIENT__ATTRIBUTE_TYPE; default: return -1; } } @@ -329,6 +393,29 @@ public class XmlTransient extends org.eclipse.jpt.jpa.core.resource.orm.XmlTrans } + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() + { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (attributeType: "); + result.append(attributeType); + result.append(')'); + return result.toString(); + } + + public TextRange getAttributeTypeTextRange() { + //no attribute-type for one-to-one + return getValidationTextRange(); + } + + // ********** translators ********** public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) { diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVariableOneToOne.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVariableOneToOne.java index deb55410b6..6189e84eb7 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVariableOneToOne.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVariableOneToOne.java @@ -21,8 +21,10 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator; +import org.eclipse.jpt.common.core.utility.TextRange; import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping; import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys; +import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2; @@ -85,6 +87,26 @@ public class XmlVariableOneToOne extends AbstractXmlAttributeMapping implements protected EList<XmlProperty> properties; /** + * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getAttributeType() + * @generated + * @ordered + */ + protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; + + /** * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -329,6 +351,41 @@ public class XmlVariableOneToOne extends AbstractXmlAttributeMapping implements } /** + * Returns the value of the '<em><b>Attribute Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Attribute Type</em>' attribute. + * @see #setAttributeType(String) + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() + * @model dataType="org.eclipse.emf.ecore.xml.type.String" + * @generated + */ + public String getAttributeType() + { + return attributeType; + } + + /** + * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getAttributeType <em>Attribute Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Attribute Type</em>' attribute. + * @see #getAttributeType() + * @generated + */ + public void setAttributeType(String newAttributeType) + { + String oldAttributeType = attributeType; + attributeType = newAttributeType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ATTRIBUTE_TYPE, oldAttributeType, attributeType)); + } + + /** * Returns the value of the '<em><b>Partitioning</b></em>' containment reference. * <!-- begin-user-doc --> * <p> @@ -913,10 +970,6 @@ public class XmlVariableOneToOne extends AbstractXmlAttributeMapping implements eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__TARGET_INTERFACE, oldTargetInterface, targetInterface)); } - public String getTypeName() { - return this.getTargetInterface(); - } - /** * <!-- begin-user-doc --> * <!-- end-user-doc --> @@ -965,6 +1018,8 @@ public class XmlVariableOneToOne extends AbstractXmlAttributeMapping implements return getAccessMethods(); case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES: return getProperties(); + case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ATTRIBUTE_TYPE: + return getAttributeType(); case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING: return getPartitioning(); case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING: @@ -1009,6 +1064,9 @@ public class XmlVariableOneToOne extends AbstractXmlAttributeMapping implements getProperties().clear(); getProperties().addAll((Collection<? extends XmlProperty>)newValue); return; + case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ATTRIBUTE_TYPE: + setAttributeType((String)newValue); + return; case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING: setPartitioning((XmlPartitioning_2_2)newValue); return; @@ -1062,6 +1120,9 @@ public class XmlVariableOneToOne extends AbstractXmlAttributeMapping implements case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES: getProperties().clear(); return; + case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ATTRIBUTE_TYPE: + setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); + return; case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING: setPartitioning((XmlPartitioning_2_2)null); return; @@ -1113,6 +1174,8 @@ public class XmlVariableOneToOne extends AbstractXmlAttributeMapping implements return accessMethods != null; case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES: return properties != null && !properties.isEmpty(); + case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ATTRIBUTE_TYPE: + return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING: return partitioning != null; case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING: @@ -1167,6 +1230,7 @@ public class XmlVariableOneToOne extends AbstractXmlAttributeMapping implements { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -1225,6 +1289,7 @@ public class XmlVariableOneToOne extends AbstractXmlAttributeMapping implements { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ATTRIBUTE_TYPE; default: return -1; } } @@ -1266,7 +1331,9 @@ public class XmlVariableOneToOne extends AbstractXmlAttributeMapping implements if (eIsProxy()) return super.toString(); StringBuffer result = new StringBuffer(super.toString()); - result.append(" (partitioned: "); + result.append(" (attributeType: "); + result.append(attributeType); + result.append(", partitioned: "); result.append(partitioned); result.append(", nonCacheable: "); result.append(nonCacheable); @@ -1279,6 +1346,10 @@ public class XmlVariableOneToOne extends AbstractXmlAttributeMapping implements public String getMappingKey() { return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY; } + + public TextRange getAttributeTypeTextRange() { + return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE); + } // ********** translators ********** diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVersion.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVersion.java index bbcad71dbf..51f8fdf56c 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVersion.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVersion.java @@ -22,7 +22,6 @@ import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package; -import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlVersion_2_1; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package; import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2; @@ -52,57 +51,57 @@ import org.eclipse.wst.common.internal.emf.resource.Translator; * @model kind="class" * @generated */ -public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion implements XmlVersion_2_1, XmlVersion_2_2, XmlAttributeMapping, XmlMutable, XmlConvertibleMapping, XmlConverterContainer +public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion implements XmlVersion_2_2, XmlAttributeMapping, XmlMutable, XmlConvertibleMapping, XmlConverterContainer { /** - * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * The cached value of the '{@link #getIndex() <em>Index</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getAttributeType() + * @see #getIndex() * @generated * @ordered */ - protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; + protected XmlIndex_2_2 index; /** - * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. + * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getAttributeType() + * @see #getAccessMethods() * @generated * @ordered */ - protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; + protected XmlAccessMethods accessMethods; /** - * The cached value of the '{@link #getIndex() <em>Index</em>}' containment reference. + * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getIndex() + * @see #getProperties() * @generated * @ordered */ - protected XmlIndex_2_2 index; + protected EList<XmlProperty> properties; /** - * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference. + * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getAccessMethods() + * @see #getAttributeType() * @generated * @ordered */ - protected XmlAccessMethods accessMethods; + protected static final String ATTRIBUTE_TYPE_EDEFAULT = null; /** - * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list. + * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> - * @see #getProperties() + * @see #getAttributeType() * @generated * @ordered */ - protected EList<XmlProperty> properties; + protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT; /** * The default value of the '{@link #getMutable() <em>Mutable</em>}' attribute. @@ -215,7 +214,7 @@ public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion * <!-- end-user-doc --> * @return the value of the '<em>Attribute Type</em>' attribute. * @see #setAttributeType(String) - * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVersion_2_1_AttributeType() + * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType() * @model dataType="org.eclipse.emf.ecore.xml.type.String" * @generated */ @@ -462,10 +461,6 @@ public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion return structConverters; } - public String getTypeName() { - return this.getAttributeType(); - } - /** * Returns the value of the '<em><b>Access Methods</b></em>' containment reference. * <!-- begin-user-doc --> @@ -587,14 +582,14 @@ public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion { switch (featureID) { - case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE: - return getAttributeType(); case EclipseLinkOrmPackage.XML_VERSION__INDEX: return getIndex(); case EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS: return getAccessMethods(); case EclipseLinkOrmPackage.XML_VERSION__PROPERTIES: return getProperties(); + case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE: + return getAttributeType(); case EclipseLinkOrmPackage.XML_VERSION__MUTABLE: return getMutable(); case EclipseLinkOrmPackage.XML_VERSION__CONVERT: @@ -622,9 +617,6 @@ public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion { switch (featureID) { - case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE: - setAttributeType((String)newValue); - return; case EclipseLinkOrmPackage.XML_VERSION__INDEX: setIndex((XmlIndex_2_2)newValue); return; @@ -635,6 +627,9 @@ public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion getProperties().clear(); getProperties().addAll((Collection<? extends XmlProperty>)newValue); return; + case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE: + setAttributeType((String)newValue); + return; case EclipseLinkOrmPackage.XML_VERSION__MUTABLE: setMutable((Boolean)newValue); return; @@ -671,9 +666,6 @@ public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion { switch (featureID) { - case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE: - setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); - return; case EclipseLinkOrmPackage.XML_VERSION__INDEX: setIndex((XmlIndex_2_2)null); return; @@ -683,6 +675,9 @@ public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion case EclipseLinkOrmPackage.XML_VERSION__PROPERTIES: getProperties().clear(); return; + case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE: + setAttributeType(ATTRIBUTE_TYPE_EDEFAULT); + return; case EclipseLinkOrmPackage.XML_VERSION__MUTABLE: setMutable(MUTABLE_EDEFAULT); return; @@ -715,14 +710,14 @@ public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion { switch (featureID) { - case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE: - return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_VERSION__INDEX: return index != null; case EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS: return accessMethods != null; case EclipseLinkOrmPackage.XML_VERSION__PROPERTIES: return properties != null && !properties.isEmpty(); + case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE: + return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType); case EclipseLinkOrmPackage.XML_VERSION__MUTABLE: return MUTABLE_EDEFAULT == null ? mutable != null : !MUTABLE_EDEFAULT.equals(mutable); case EclipseLinkOrmPackage.XML_VERSION__CONVERT: @@ -747,14 +742,6 @@ public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion @Override public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { - if (baseClass == XmlVersion_2_1.class) - { - switch (derivedFeatureID) - { - case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE: return EclipseLinkOrmV2_1Package.XML_VERSION_21__ATTRIBUTE_TYPE; - default: return -1; - } - } if (baseClass == XmlVersion_2_2.class) { switch (derivedFeatureID) @@ -783,6 +770,7 @@ public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion { switch (derivedFeatureID) { + case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE; default: return -1; } } @@ -824,14 +812,6 @@ public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion @Override public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { - if (baseClass == XmlVersion_2_1.class) - { - switch (baseFeatureID) - { - case EclipseLinkOrmV2_1Package.XML_VERSION_21__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE; - default: return -1; - } - } if (baseClass == XmlVersion_2_2.class) { switch (baseFeatureID) @@ -860,6 +840,7 @@ public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion { switch (baseFeatureID) { + case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE; default: return -1; } } @@ -921,7 +902,11 @@ public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion public TextRange getConvertTextRange() { return getElementTextRange(EclipseLink.CONVERT); } - + + public TextRange getAttributeTypeTextRange() { + return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE); + } + // ********** translators ********** @@ -989,7 +974,7 @@ public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion } protected static Translator buildAttributeTypeTranslator() { - return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlVersion_2_1_AttributeType(), Translator.DOM_ATTRIBUTE); + return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE); } } diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_validation_preferences.properties b/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_validation_preferences.properties index 9cce7b9318..f1ef365c4b 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_validation_preferences.properties +++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_validation_preferences.properties @@ -56,7 +56,6 @@ PERSISTENT_TYPE_ANNOTATED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT=Class is annotate PERSISTENT_TYPE_MAPPED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT=Class is mapped, but is not in a persistence unit: PERSISTENT_TYPE_UNRESOLVED_CLASS=Class in orm.xml cannot be resolved to a java class: PERSISTENT_TYPE_UNSPECIFIED_CLASS=Class is unspecified in orm.xml: -TARGET_NOT_AN_EMBEDDABLE=Target type of an embedded mapping is not an embeddable: TYPE_MAPPING_CLASS_MISSING_NO_ARG_CONSTRUCTOR=Mapped Java class has no no-arg constructor: TYPE_MAPPING_CLASS_PRIVATE_NO_ARG_CONSTRUCTOR=Mapped Java class has a private no-arg constructor: TYPE_MAPPING_FINAL_CLASS=Mapped Java class is final: @@ -122,8 +121,11 @@ PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME=Attribute in orm.xml has unspecified name: TARGET_ENTITY_IS_NOT_AN_ENTITY=Target entity is not an Entity: TARGET_ENTITY_NOT_DEFINED=Target entity is not defined: TARGET_ENTITY_NOT_EXIST=Target entity does not exist on the project classpath: +TARGET_NOT_AN_EMBEDDABLE=Target type of an embedded mapping is not an embeddable: MAP_KEY_CLASS_NOT_DEFINED=Map key class not defined: MAP_KEY_CLASS_NOT_EXIST=Map key class does not exist on the project classpath: +MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE=Map key class is not entity, embeddable or basic type: +ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE=Collection mapping attribute type must be java.util.Collection, java.util.Set, java.util.List or java.util.Map: VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST=Element collection target class does not exist on the project classpath: VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE=Element collection target class is not embeddable or basic type: @@ -138,11 +140,12 @@ VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS=Emb VIRTUAL_ATTRIBUTE_EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED=Embedded IDs that are mapped by a relationship should not specify any attribute overrides: VIRTUAL_ATTRIBUTE_TARGET_ENTITY_IS_NOT_AN_ENTITY=Target entity is not an Entity: VIRTUAL_ATTRIBUTE_TARGET_ENTITY_NOT_DEFINED=Target entity is not defined: +VIRTUAL_ATTRIBUTE_TARGET_NOT_AN_EMBEDDABLE=Target type of an embedded mapping is not an embeddable: VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_NOT_DEFINED=Map key class not defined: VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE=Persistence field/property map key type is invalid for a Temporal mapping: VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE=Element collection value type is invalid for a Temporal mapping: VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE=Persistence field/property type is invalid for a Temporal mapping: - +VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE=Collection mapping attribute type must be java.util.Collection, java.util.Set, java.util.List or java.util.Map: DATABASE_CATEGORY=Database TABLE_CATEGORY=Table diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiValidationPreferenceMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiValidationPreferenceMessages.java index 6ee558b5a1..70bd05765b 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiValidationPreferenceMessages.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiValidationPreferenceMessages.java @@ -64,7 +64,6 @@ public class JptUiValidationPreferenceMessages { public static String PERSISTENT_TYPE_MAPPED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT; public static String PERSISTENT_TYPE_UNRESOLVED_CLASS; public static String PERSISTENT_TYPE_UNSPECIFIED_CLASS; - public static String TARGET_NOT_AN_EMBEDDABLE; //3.0 M7 public static String TYPE_MAPPING_CLASS_MISSING_NO_ARG_CONSTRUCTOR; public static String TYPE_MAPPING_CLASS_PRIVATE_NO_ARG_CONSTRUCTOR; public static String TYPE_MAPPING_FINAL_CLASS; @@ -107,7 +106,6 @@ public class JptUiValidationPreferenceMessages { public static String EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR; public static String EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_SERIALIZABLE; public static String EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS; - public static String EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED; //3.0 M7 public static String ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_COLUMN_SPECIFIED; //3.0 M7 public static String MAPS_ID_VALUE_INVALID; @@ -132,8 +130,12 @@ public class JptUiValidationPreferenceMessages { public static String TARGET_ENTITY_IS_NOT_AN_ENTITY; public static String TARGET_ENTITY_NOT_DEFINED; public static String TARGET_ENTITY_NOT_EXIST; + public static String TARGET_NOT_AN_EMBEDDABLE; //3.0 M7 public static String MAP_KEY_CLASS_NOT_DEFINED; public static String MAP_KEY_CLASS_NOT_EXIST; + public static String MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE; + public static String ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE; + // ---------- Implied Attributes ------------ public static String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST; public static String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE; @@ -142,17 +144,20 @@ public class JptUiValidationPreferenceMessages { public static String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_PROHIBITED_RELATIONSHIP_MAPPING; public static String VIRTUAL_ATTRIBUTE_TARGET_ENTITY_IS_NOT_AN_ENTITY; public static String VIRTUAL_ATTRIBUTE_TARGET_ENTITY_NOT_DEFINED; + public static String VIRTUAL_ATTRIBUTE_TARGET_NOT_AN_EMBEDDABLE; public static String VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_NOT_DEFINED; + public static String VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE; public static String VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE; public static String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE; public static String VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE; + public static String VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE; public static String VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR; public static String VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_EQUALS_HASHCODE; public static String VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS; public static String VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_SERIALIZABLE; public static String VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_BE_PUBLIC; public static String VIRTUAL_ATTRIBUTE_EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED; - + // Database Category public static String DATABASE_CATEGORY; diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/preferences/JpaProblemSeveritiesPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/preferences/JpaProblemSeveritiesPage.java index 3cbb41b307..402b4c2610 100644 --- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/preferences/JpaProblemSeveritiesPage.java +++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/preferences/JpaProblemSeveritiesPage.java @@ -329,7 +329,6 @@ public class JpaProblemSeveritiesPage extends PropertyAndPreferencePage { addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_TYPE_MAPPED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT, JpaValidationMessages.PERSISTENT_TYPE_MAPPED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT); addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_TYPE_UNRESOLVED_CLASS, JpaValidationMessages.PERSISTENT_TYPE_UNRESOLVED_CLASS); addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_TYPE_UNSPECIFIED_CLASS, JpaValidationMessages.PERSISTENT_TYPE_UNSPECIFIED_CLASS); - addLabeledCombo(parent, JptUiValidationPreferenceMessages.TARGET_NOT_AN_EMBEDDABLE, JpaValidationMessages.TARGET_NOT_AN_EMBEDDABLE); //3.0 M7 addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_CLASS_MISSING_NO_ARG_CONSTRUCTOR, JpaValidationMessages.TYPE_MAPPING_CLASS_MISSING_NO_ARG_CONSTRUCTOR); addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_CLASS_PRIVATE_NO_ARG_CONSTRUCTOR, JpaValidationMessages.TYPE_MAPPING_CLASS_PRIVATE_NO_ARG_CONSTRUCTOR); addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_FINAL_CLASS, JpaValidationMessages.TYPE_MAPPING_FINAL_CLASS); @@ -397,8 +396,11 @@ public class JpaProblemSeveritiesPage extends PropertyAndPreferencePage { addLabeledCombo(parent, JptUiValidationPreferenceMessages.TARGET_ENTITY_IS_NOT_AN_ENTITY, JpaValidationMessages.TARGET_ENTITY_IS_NOT_AN_ENTITY); addLabeledCombo(parent, JptUiValidationPreferenceMessages.TARGET_ENTITY_NOT_DEFINED, JpaValidationMessages.TARGET_ENTITY_NOT_DEFINED); addLabeledCombo(parent, JptUiValidationPreferenceMessages.TARGET_ENTITY_NOT_EXIST, JpaValidationMessages.TARGET_ENTITY_NOT_EXIST); + addLabeledCombo(parent, JptUiValidationPreferenceMessages.TARGET_NOT_AN_EMBEDDABLE, JpaValidationMessages.TARGET_NOT_AN_EMBEDDABLE); //3.0 M7 addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAP_KEY_CLASS_NOT_DEFINED, JpaValidationMessages.MAP_KEY_CLASS_NOT_DEFINED); addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAP_KEY_CLASS_NOT_EXIST, JpaValidationMessages.MAP_KEY_CLASS_NOT_EXIST); + addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE, JpaValidationMessages.MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE); + addLabeledCombo(parent, JptUiValidationPreferenceMessages.ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE, JpaValidationMessages.ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE); parent = addSubExpandableSection(parent, JptUiValidationPreferenceMessages.IMPLIED_ATTRIBUTE_LEVEL_CATEGORY); @@ -415,10 +417,13 @@ public class JpaProblemSeveritiesPage extends PropertyAndPreferencePage { addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED, JpaValidationMessages.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED); addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_TARGET_ENTITY_IS_NOT_AN_ENTITY, JpaValidationMessages.VIRTUAL_ATTRIBUTE_TARGET_ENTITY_IS_NOT_AN_ENTITY); addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_TARGET_ENTITY_NOT_DEFINED, JpaValidationMessages.VIRTUAL_ATTRIBUTE_TARGET_ENTITY_NOT_DEFINED); + addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_TARGET_NOT_AN_EMBEDDABLE, JpaValidationMessages.VIRTUAL_ATTRIBUTE_TARGET_NOT_AN_EMBEDDABLE); addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_NOT_DEFINED, JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_NOT_DEFINED); + addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE, JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE); addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE, JpaValidationMessages.VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE); - addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE); + addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE); addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE, JpaValidationMessages.VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE); + addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE); } private void addDatabaseCategory(Composite parent) { |