From: Cherian Mathew Date: Wed, 9 Sep 2015 15:47:02 +0000 (+0200) Subject: #5225 Replace saveOrUpdate with merge for new entity wizards X-Git-Tag: remoting-3.9.0~17 X-Git-Url: https://dev.e-taxonomy.eu/gitweb/taxeditor.git/commitdiff_plain/2e93b829d61a797ef5903a16f865b3f7f115eae1 #5225 Replace saveOrUpdate with merge for new entity wizards --- diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewAmplificationWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewAmplificationWizard.java index e9f2eef6a..02012cdbb 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewAmplificationWizard.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewAmplificationWizard.java @@ -38,7 +38,7 @@ public class NewAmplificationWizard extends AbstractNewEntityWizard { public void addPages() { addPage(new CollectionWizardPage(formFactory, getConversationHolder(), getEntity())); } - + /* (non-Javadoc) * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#saveEntity() */ /** {@inheritDoc} */ @Override protected void saveEntity() { - CdmStore.getService(ICollectionService.class).saveOrUpdate(getEntity()); + CdmStore.getService(ICollectionService.class).merge(getEntity()); } /* (non-Javadoc) @@ -52,5 +52,5 @@ public class NewCollectionWizard extends AbstractNewEntityWizard { protected String getEntityName() { return "Collection"; } - + } diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewDerivedUnitBaseWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewDerivedUnitBaseWizard.java index 684901431..5e32239b7 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewDerivedUnitBaseWizard.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewDerivedUnitBaseWizard.java @@ -102,7 +102,7 @@ public class NewDerivedUnitBaseWizard extends AbstractNewEntityWizard { /** {@inheritDoc} */ @Override protected void saveEntity() { - CdmStore.getService(IOccurrenceService.class).saveOrUpdate(getEntity()); + CdmStore.getService(IOccurrenceService.class).merge(getEntity()); } @Override diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewGrantedAuthorityWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewGrantedAuthorityWizard.java index d14e60819..4a3fb425c 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewGrantedAuthorityWizard.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewGrantedAuthorityWizard.java @@ -1,9 +1,9 @@ // $Id$ /** * Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy +* European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu -* +* * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ @@ -20,9 +20,9 @@ import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetail * @created Sept 13 2012 */ public class NewGrantedAuthorityWizard extends AbstractNewEntityWizard { - + private GrantedAuthorityDetailWizardPage authorityPage; - + /* (non-Javadoc) * @see org.eclipse.jface.wizard.Wizard#addPages() */ @@ -38,7 +38,7 @@ public class NewGrantedAuthorityWizard extends AbstractNewEntityWizard { private GroupDetailWizardPage groupPage; - + /* (non-Javadoc) * @see org.eclipse.jface.wizard.Wizard#addPages() */ @@ -32,13 +32,13 @@ public class NewGroupWizard extends AbstractNewEntityWizard { groupPage = new GroupDetailWizardPage(formFactory, getConversationHolder(), getEntity()); super.addPage(groupPage); } - + /* (non-Javadoc) * @see eu.etaxonomy.taxeditor.newWizard.AbstractNewEntityWizard#saveEntity() */ @Override protected void saveEntity() { - CdmStore.getService(IGroupService.class).saveOrUpdate(getEntity()); + CdmStore.getService(IGroupService.class).merge(getEntity()); } /* (non-Javadoc) diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewInstitutionWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewInstitutionWizard.java index 1eba0be64..c14d13ab0 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewInstitutionWizard.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewInstitutionWizard.java @@ -1,9 +1,9 @@ // $Id$ /** * Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy +* European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu -* +* * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ @@ -29,13 +29,13 @@ public class NewInstitutionWizard extends AbstractNewEntityWizard { public void addPages() { addPage(new InstitutionWizardPage(formFactory, getConversationHolder(), getEntity())); } - + /* (non-Javadoc) * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#saveEntity() */ @Override protected void saveEntity() { - CdmStore.getService(IAgentService.class).saveOrUpdate(getEntity()); + CdmStore.getService(IAgentService.class).merge(getEntity()); } /* (non-Javadoc) diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewNonViralNameWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewNonViralNameWizard.java index 6e6ec0886..575f6a7ee 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewNonViralNameWizard.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewNonViralNameWizard.java @@ -1,9 +1,9 @@ // $Id$ /** * Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy +* European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu -* +* * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ @@ -33,7 +33,7 @@ public class NewNonViralNameWizard extends AbstractNewEntityWizard public void addPages() { addPage(new NonViralNameWizardPage(formFactory, getConversationHolder(), getEntity())); } - + /** {@inheritDoc} */ @Override protected NonViralName createNewEntity() { @@ -49,7 +49,7 @@ public class NewNonViralNameWizard extends AbstractNewEntityWizard /** {@inheritDoc} */ @Override protected void saveEntity() { - CdmStore.getService(INameService.class).saveOrUpdate(getEntity()); + CdmStore.getService(INameService.class).merge(getEntity()); } @Override diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPersonWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPersonWizard.java index da1878766..abb03bd1c 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPersonWizard.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPersonWizard.java @@ -1,9 +1,9 @@ // $Id$ /** * Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy +* European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu -* +* * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ @@ -29,7 +29,7 @@ public class NewPersonWizard extends AbstractNewEntityWizard { public void addPages() { addPage(new PersonWizardPage(formFactory, getConversationHolder(), getEntity())); } - + /** {@inheritDoc} */ @Override protected Person createNewEntity() { @@ -39,7 +39,7 @@ public class NewPersonWizard extends AbstractNewEntityWizard { /** {@inheritDoc} */ @Override protected void saveEntity() { - CdmStore.getService(IAgentService.class).saveOrUpdate(getEntity()); + CdmStore.getService(IAgentService.class).merge(getEntity()); } @Override diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPolytomousKeyWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPolytomousKeyWizard.java index 8a9d17db5..9333780ac 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPolytomousKeyWizard.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPolytomousKeyWizard.java @@ -1,5 +1,5 @@ /** - * + * */ package eu.etaxonomy.taxeditor.newWizard; @@ -14,24 +14,24 @@ import eu.etaxonomy.taxeditor.store.CdmStore; public class NewPolytomousKeyWizard extends AbstractNewEntityWizard { private PolytomousKeyWizardPage polytomousKeyPage; - + @Override public void addPages() { polytomousKeyPage = new PolytomousKeyWizardPage(formFactory, getConversationHolder(), getEntity()); super.addPage(polytomousKeyPage); } - + public String getPolytomousKeyName() { return polytomousKeyPage.getPolytomousKeyName(); } - + /* (non-Javadoc) * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#saveEntity() */ @Override protected void saveEntity() { if(!polytomousKeyPage.getPolytomousKeyName().equals("")) { - CdmStore.getService(IPolytomousKeyService.class).saveOrUpdate(getEntity()); + CdmStore.getService(IPolytomousKeyService.class).merge(getEntity()); } } diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPrimerWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPrimerWizard.java index dbe73be46..1e31797d6 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPrimerWizard.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewPrimerWizard.java @@ -38,7 +38,7 @@ public class NewPrimerWizard extends AbstractNewEntityWizard { /** {@inheritDoc} */ @Override protected void saveEntity() { - CdmStore.getService(IPrimerService.class).saveOrUpdate(getEntity()); + CdmStore.getService(IPrimerService.class).merge(getEntity()); } /** {@inheritDoc} */ diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewReferenceWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewReferenceWizard.java index f1b19c94a..f89d0458e 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewReferenceWizard.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewReferenceWizard.java @@ -1,9 +1,9 @@ // $Id$ /** * Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy +* European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu -* +* * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ @@ -24,9 +24,9 @@ import eu.etaxonomy.taxeditor.ui.section.reference.ReferenceWizardPage; * @version 1.0 */ public class NewReferenceWizard extends AbstractNewEntityWizard { - + private ReferenceWizardPage referencePage; - + /** {@inheritDoc} */ @Override public void addPages() { @@ -45,7 +45,7 @@ public class NewReferenceWizard extends AbstractNewEntityWizard { /** {@inheritDoc} */ @Override protected void saveEntity() { - CdmStore.getService(IReferenceService.class).saveOrUpdate(getEntity()); + CdmStore.getService(IReferenceService.class).save(getEntity()); } /** {@inheritDoc} */ diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTeamWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTeamWizard.java index 050b59843..faf7cb340 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTeamWizard.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTeamWizard.java @@ -1,9 +1,9 @@ // $Id$ /** * Copyright (C) 2007 EDIT -* European Distributed Institute of Taxonomy +* European Distributed Institute of Taxonomy * http://www.e-taxonomy.eu -* +* * The contents of this file are subject to the Mozilla Public License Version 1.1 * See LICENSE.TXT at the top of this package for the full license terms. */ @@ -29,7 +29,7 @@ public class NewTeamWizard extends AbstractNewEntityWizard { public void addPages() { addPage(new TeamWizardPage(formFactory, getConversationHolder(), getEntity())); } - + /* (non-Javadoc) * @see eu.etaxonomy.taxeditor.editor.newWizard.AbstractNewEntityWizard#createNewEntity() */ @@ -42,7 +42,7 @@ public class NewTeamWizard extends AbstractNewEntityWizard { /** {@inheritDoc} */ @Override protected void saveEntity() { - CdmStore.getService(IAgentService.class).saveOrUpdate(getEntity()); + CdmStore.getService(IAgentService.class).merge(getEntity()); } @Override diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewUserWizard.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewUserWizard.java index aa3cd19dd..322b798dc 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewUserWizard.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewUserWizard.java @@ -1,5 +1,5 @@ /** - * + * */ package eu.etaxonomy.taxeditor.newWizard; @@ -15,16 +15,16 @@ import eu.etaxonomy.taxeditor.ui.section.user.UserDetailWizardPage; public class NewUserWizard extends AbstractNewEntityWizard { private UserDetailWizardPage userPage; - + @Override public void addPages() { userPage = new UserDetailWizardPage(formFactory, getConversationHolder(), getEntity()); addPage(userPage); } - + @Override protected void saveEntity() { - CdmStore.getService(IUserService.class).saveOrUpdate(getEntity()); + CdmStore.getService(IUserService.class).merge(getEntity()); } @Override diff --git a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmResourceSelectionDialog.java b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmResourceSelectionDialog.java index 4d9194515..e48ae2775 100644 --- a/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmResourceSelectionDialog.java +++ b/eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/AbstractFilteredCdmResourceSelectionDialog.java @@ -71,6 +71,7 @@ public abstract class AbstractFilteredCdmResourceSelectionDialogConstructor for AbstractFilteredCdmResourceSelectionDialog.

* @@ -484,6 +485,9 @@ public abstract class AbstractFilteredCdmResourceSelectionDialog(entity.getUuid(), + entity.getId(), + getTitle(entity))); refresh(); setPattern(entity); getConversationHolder().bind();