Fix association creation
authorPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 11 Nov 2015 12:38:42 +0000 (13:38 +0100)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Wed, 11 Nov 2015 12:38:42 +0000 (13:38 +0100)
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/derivate/contextMenu/CreateFieldUnitContextMenu.java

index 838e5c081411dd4b4eda74c7361ad64049d4fd4a..48c38c82ff5d142dfe0ecce5eade106cf7052414 100644 (file)
@@ -15,7 +15,6 @@ import org.eclipse.ui.actions.CompoundContributionItem;
 import eu.etaxonomy.cdm.api.service.IOccurrenceService;
 import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
 import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.model.description.Feature;
 import eu.etaxonomy.cdm.model.description.IndividualsAssociation;
 import eu.etaxonomy.cdm.model.description.TaxonDescription;
 import eu.etaxonomy.cdm.model.occurrence.FieldUnit;
@@ -60,7 +59,6 @@ public class CreateFieldUnitContextMenu extends CompoundContributionItem {
                                             FieldUnit fieldUnit = FieldUnit.NewInstance();
                                             fieldUnit = CdmBase.deproxy(CdmStore.getService(IOccurrenceService.class).save(fieldUnit), FieldUnit.class);
                                             IndividualsAssociation association = IndividualsAssociation.NewInstance(fieldUnit);
-                                            association.setFeature(Feature.SPECIMEN());
                                             TaxonDescription description;
                                             if(!taxon.getDescriptions().isEmpty()){
                                                 description = taxon.getDescriptions().iterator().next();
@@ -68,7 +66,7 @@ public class CreateFieldUnitContextMenu extends CompoundContributionItem {
                                             else{
                                                 description = TaxonDescription.NewInstance(taxon);
                                             }
-                                            description.addElement(IndividualsAssociation.NewInstance(fieldUnit));
+                                            description.addElement(association);
 
                                             derivateView.getConversationHolder().commit();
                                             derivateView.addFieldUnit(fieldUnit);