Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/mapper/DefaultAnnotator.java19
1 files changed, 12 insertions, 7 deletions
diff --git a/plugins/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/mapper/DefaultAnnotator.java b/plugins/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/mapper/DefaultAnnotator.java
index 72f714357..76788f1a2 100644
--- a/plugins/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/mapper/DefaultAnnotator.java
+++ b/plugins/org.eclipse.emf.teneo.annotations/src/org/eclipse/emf/teneo/annotations/mapper/DefaultAnnotator.java
@@ -11,7 +11,7 @@
* Martin Taal
* </copyright>
*
- * $Id: DefaultAnnotator.java,v 1.22 2007/02/05 13:04:53 mtaal Exp $
+ * $Id: DefaultAnnotator.java,v 1.23 2007/02/05 13:20:48 mtaal Exp $
*/
package org.eclipse.emf.teneo.annotations.mapper;
@@ -80,7 +80,7 @@ import org.eclipse.emf.teneo.util.StoreUtil;
* information. It sets the default annotations according to the ejb3 spec.
*
* @author <a href="mailto:mtaal@elver.org">Martin Taal</a>
- * @version $Revision: 1.22 $
+ * @version $Revision: 1.23 $
*/
public class DefaultAnnotator {
@@ -346,7 +346,9 @@ public class DefaultAnnotator {
if (!firstDone) {
superClass = eSuperClass;
}
- idFeatures.addAll(getIDFeaturesNames(aSuperClass));
+ final List superList = getIDFeaturesNames(aSuperClass);
+ idFeatures.removeAll(superList);
+ idFeatures.addAll(superList);
if (!idFeatures.isEmpty())
break;
}
@@ -1324,9 +1326,10 @@ public class DefaultAnnotator {
EStructuralFeature feature = (EStructuralFeature) it.next();
PAnnotatedEStructuralFeature aStructuralFeature = aClass.getPaModel().getPAnnotated(feature);
if (aStructuralFeature instanceof PAnnotatedEAttribute) {
- PAnnotatedEAttribute aAttribute = (PAnnotatedEAttribute) aStructuralFeature;
- if (aAttribute.getId() != null) {
- list.add(aAttribute.getAnnotatedEAttribute().getName());
+ final PAnnotatedEAttribute aAttribute = (PAnnotatedEAttribute) aStructuralFeature;
+ final String attrName = aAttribute.getAnnotatedEAttribute().getName();
+ if (aAttribute.getId() != null && !list.contains(attrName)) {
+ list.add(attrName);
}
}
}
@@ -1336,7 +1339,9 @@ public class DefaultAnnotator {
final EClass eClass = (EClass) it.next();
final PAnnotatedEClass aSuperClass = annotatedModel.getPAnnotated(eClass);
if (aSuperClass != null) {
- list.addAll(getIDFeaturesNamesRecurse(aSuperClass));
+ final List superList = getIDFeaturesNamesRecurse(aSuperClass);
+ list.removeAll(superList);
+ list.addAll(superList);
}
if (!list.isEmpty()) {
return list;

Back to the top