import eu.etaxonomy.cdm.api.service.IGrantedAuthorityService;
import eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl;
+import eu.etaxonomy.taxeditor.l10n.Messages;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
import eu.etaxonomy.taxeditor.store.CdmStore;
import eu.etaxonomy.taxeditor.ui.section.grantedAuthority.GrantedAuthorityDetailWizardPage;
*/
@Override
protected void saveEntity() {
- CdmStore.getService(IGrantedAuthorityService.class).merge(getEntity(), true);
-
+ try{
+ CdmStore.getService(IGrantedAuthorityService.class).merge(getEntity(), true);
+ }catch (Exception e){
+ MessagingUtils.info(Messages.NewGrantedAuthority_AlreadyInDb);
+ }
+
}
/* (non-Javadoc)
*/
@Override
protected GrantedAuthorityImpl createNewEntity() {
- return GrantedAuthorityImpl.NewInstance();
+ return GrantedAuthorityImpl.NewInstance("");
}
/* (non-Javadoc)