Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormtaal2007-04-21 09:19:06 +0000
committermtaal2007-04-21 09:19:06 +0000
commit19cffe083d4799a269946891a2560f2aac7af556 (patch)
tree4ad4080fd2431bb35fb3a7e66c9123c54ab792db
parent3782ac6398b2169ce4676864dbef5beb4d3d8f05 (diff)
downloadorg.eclipse.emf.teneo-19cffe083d4799a269946891a2560f2aac7af556.tar.gz
org.eclipse.emf.teneo-19cffe083d4799a269946891a2560f2aac7af556.tar.xz
org.eclipse.emf.teneo-19cffe083d4799a269946891a2560f2aac7af556.zip
[183497]
[183495] [181492] [181472]
-rw-r--r--plugins/org.eclipse.emf.teneo.hibernate.mapper/src/org/eclipse/emf/teneo/hibernate/mapper/FeatureMapMapping.java22
1 files changed, 19 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.teneo.hibernate.mapper/src/org/eclipse/emf/teneo/hibernate/mapper/FeatureMapMapping.java b/plugins/org.eclipse.emf.teneo.hibernate.mapper/src/org/eclipse/emf/teneo/hibernate/mapper/FeatureMapMapping.java
index 498cbb2dd..9e9f7fb1e 100644
--- a/plugins/org.eclipse.emf.teneo.hibernate.mapper/src/org/eclipse/emf/teneo/hibernate/mapper/FeatureMapMapping.java
+++ b/plugins/org.eclipse.emf.teneo.hibernate.mapper/src/org/eclipse/emf/teneo/hibernate/mapper/FeatureMapMapping.java
@@ -12,7 +12,7 @@
* Davide Marchignoli
* </copyright>
*
- * $Id: FeatureMapMapping.java,v 1.5.2.1 2007/03/04 21:20:47 mtaal Exp $
+ * $Id: FeatureMapMapping.java,v 1.5.2.2 2007/04/21 09:19:06 mtaal Exp $
*/
package org.eclipse.emf.teneo.hibernate.mapper;
@@ -27,6 +27,7 @@ import org.eclipse.emf.ecore.util.FeatureMapUtil;
import org.eclipse.emf.teneo.annotations.pamodel.PAnnotatedEAttribute;
import org.eclipse.emf.teneo.annotations.pamodel.PAnnotatedEClass;
import org.eclipse.emf.teneo.annotations.pamodel.PAnnotatedEStructuralFeature;
+import org.eclipse.emf.teneo.annotations.pannotation.Id;
import org.eclipse.emf.teneo.annotations.pannotation.Transient;
import org.eclipse.emf.teneo.simpledom.Element;
import org.eclipse.emf.teneo.util.StoreUtil;
@@ -104,10 +105,25 @@ class FeatureMapMapping {
|| StoreUtil.isElementOfGroup(eFeature, paAttribute.getAnnotatedEAttribute())) {
log.debug("Feature " + StoreUtil.toString(eFeature) + " belongs to this featuremap");
// temporarily remove the transient otherwise the feature is not processed
+
+ Id id = null;
+ if (paFeature instanceof PAnnotatedEAttribute
+ && ((PAnnotatedEAttribute) paFeature).getId() != null) {
+ //Feature is an id, ignoring it for the featuremap
+ id = ((PAnnotatedEAttribute) paFeature).getId();
+ }
+
Transient tt = paFeature.getTransient();
paFeature.setTransient(null);
- fp.process(paFeature);
- paFeature.setTransient(tt);
+ try {
+ fp.process(paFeature);
+ } finally {
+ // and set the temp values back
+ paFeature.setTransient(tt);
+ if (id != null) {
+ ((PAnnotatedEAttribute) paFeature).setId(id);
+ }
+ }
}
}

Back to the top