import java.util.Set;
import java.util.UUID;
+import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import eu.etaxonomy.cdm.api.service.pager.Pager;
+import eu.etaxonomy.cdm.api.service.pager.impl.AbstractPagerImpl;
import eu.etaxonomy.cdm.api.service.pager.impl.DefaultPagerImpl;
import eu.etaxonomy.cdm.api.utility.DescriptionUtility;
import eu.etaxonomy.cdm.common.monitor.IProgressMonitor;
+import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
import eu.etaxonomy.cdm.model.common.Annotation;
+import eu.etaxonomy.cdm.model.common.AnnotationType;
+import eu.etaxonomy.cdm.model.common.CdmBase;
import eu.etaxonomy.cdm.model.common.DefinedTerm;
import eu.etaxonomy.cdm.model.common.Language;
import eu.etaxonomy.cdm.model.common.Marker;
import eu.etaxonomy.cdm.model.description.Distribution;
import eu.etaxonomy.cdm.model.description.Feature;
import eu.etaxonomy.cdm.model.description.FeatureTree;
-import eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase;
+import eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm;
import eu.etaxonomy.cdm.model.description.TaxonDescription;
import eu.etaxonomy.cdm.model.description.TaxonNameDescription;
import eu.etaxonomy.cdm.model.description.TextData;
import eu.etaxonomy.cdm.model.location.NamedArea;
import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
import eu.etaxonomy.cdm.model.media.Media;
-import eu.etaxonomy.cdm.model.name.Rank;
import eu.etaxonomy.cdm.model.name.TaxonNameBase;
import eu.etaxonomy.cdm.model.taxon.Taxon;
import eu.etaxonomy.cdm.persistence.dao.common.IDefinedTermDao;
import eu.etaxonomy.cdm.persistence.dao.description.IFeatureNodeDao;
import eu.etaxonomy.cdm.persistence.dao.description.IFeatureTreeDao;
import eu.etaxonomy.cdm.persistence.dao.description.IStatisticalMeasurementValueDao;
+import eu.etaxonomy.cdm.persistence.dao.taxon.ITaxonDao;
+import eu.etaxonomy.cdm.persistence.dto.TermDto;
import eu.etaxonomy.cdm.persistence.query.OrderHint;
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
* @created 24.06.2008
* @version 1.0
*/
+/**
+ * @author a.kohlbecker
+ * @date Dec 5, 2013
+ *
+ */
@Service
@Transactional(readOnly = true)
public class DescriptionServiceImpl extends IdentifiableServiceBase<DescriptionBase,IDescriptionDao> implements IDescriptionService {
protected ITermVocabularyDao vocabularyDao;
protected IDefinedTermDao definedTermDao;
protected IStatisticalMeasurementValueDao statisticalMeasurementValueDao;
+ protected ITaxonDao taxonDao;
+
//TODO change to Interface
private NaturalLanguageGenerator naturalLanguageGenerator;
this.naturalLanguageGenerator = naturalLanguageGenerator;
}
+ @Autowired
+ protected void setTaxonDao(ITaxonDao taxonDao) {
+ this.taxonDao = taxonDao;
+ }
+
/**
*
*/
}
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IIdentifiableEntityService#updateTitleCache(java.lang.Integer, eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy)
- */
@Override
@Transactional(readOnly = false)
public void updateTitleCache(Class<? extends DescriptionBase> clazz, Integer stepSize, IIdentifiableEntityCacheStrategy<DescriptionBase> cacheStrategy, IProgressMonitor monitor) {
}
@Override
- public Pager<DescriptionElementBase> pageDescriptionElements(DescriptionBase description, Class<? extends DescriptionBase> descriptionType,
- Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ public <T extends DescriptionElementBase> Pager<T> pageDescriptionElements(DescriptionBase description, Class<? extends DescriptionBase> descriptionType,
+ Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
- List<DescriptionElementBase> results = listDescriptionElements(description, descriptionType, features, type, pageSize, pageNumber, propertyPaths);
- return new DefaultPagerImpl<DescriptionElementBase>(pageNumber, results.size(), pageSize, results);
+ List<T> results = listDescriptionElements(description, descriptionType, features, type, pageSize, pageNumber, propertyPaths);
+ return new DefaultPagerImpl<T>(pageNumber, results.size(), pageSize, results);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IDescriptionService#getDescriptionElements(eu.etaxonomy.cdm.model.description.DescriptionBase, java.util.Set, java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List)
- */
@Override
@Deprecated
- public Pager<DescriptionElementBase> getDescriptionElements(DescriptionBase description,
- Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ public <T extends DescriptionElementBase> Pager<T> getDescriptionElements(DescriptionBase description,
+ Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
return pageDescriptionElements(description, null, features, type, pageSize, pageNumber, propertyPaths);
}
+
+
@Override
- public List<DescriptionElementBase> listDescriptionElements(DescriptionBase description, Class<? extends DescriptionBase> descriptionType,
- Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ public <T extends DescriptionElementBase> List<T> listDescriptionElements(DescriptionBase description,
+ Class<? extends DescriptionBase> descriptionType, Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber,
+ List<String> propertyPaths) {
Integer numberOfResults = dao.countDescriptionElements(description, descriptionType, features, type);
- List<DescriptionElementBase> results = new ArrayList<DescriptionElementBase>();
- if(numberOfResults > 0) { // no point checking again //TODO use AbstractPagerImpl.hasResultsInRange(numberOfResults, pageNumber, pageSize)
+ List<T> results = new ArrayList<T>();
+ if(AbstractPagerImpl.hasResultsInRange(numberOfResults.longValue(), pageNumber, pageSize)) {
results = dao.getDescriptionElements(description, descriptionType, features, type, pageSize, pageNumber, propertyPaths);
}
return results;
+
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IDescriptionService#listDescriptionElements(eu.etaxonomy.cdm.model.description.DescriptionBase, java.util.Set, java.lang.Class, java.lang.Integer, java.lang.Integer, java.util.List)
- */
+
@Override
@Deprecated
- public List<DescriptionElementBase> listDescriptionElements(DescriptionBase description,
- Set<Feature> features, Class<? extends DescriptionElementBase> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
+ public <T extends DescriptionElementBase> List<T> listDescriptionElements(DescriptionBase description,
+ Set<Feature> features, Class<T> type, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
return listDescriptionElements(description, null, features, type, pageSize, pageNumber, propertyPaths);
}
}
-
@Override
public Pager<Media> getMedia(DescriptionElementBase descriptionElement, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
Integer numberOfResults = descriptionElementDao.countMedia(descriptionElement);
return listTaxonDescriptions(taxon, scopes, geographicalScope, markerTypes, pageSize, pageNumber, propertyPaths);
}
-
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IDescriptionService#pageMarkedTaxonDescriptions(eu.etaxonomy.cdm.model.taxon.Taxon, java.util.Set, java.util.Set, java.util.Set, java.lang.Integer, java.lang.Integer, java.util.List)
- */
@Override
public Pager<TaxonDescription> pageTaxonDescriptions(Taxon taxon, Set<DefinedTerm> scopes, Set<NamedArea> geographicalScope, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
Integer numberOfResults = dao.countTaxonDescriptions(taxon, scopes, geographicalScope, markerTypes);
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IDescriptionService#listTaxonDescriptionMedia(UUID, boolean, Set, Integer, Integer, List)
- */
@Override
public List<Media> listTaxonDescriptionMedia(UUID taxonUuid, boolean limitToGalleries, Set<MarkerType> markerTypes, Integer pageSize, Integer pageNumber, List<String> propertyPaths){
return this.dao.listTaxonDescriptionMedia(taxonUuid, limitToGalleries, markerTypes, pageSize, pageNumber, propertyPaths);
}
- /*
- * @see IDescriptionService#countTaxonDescriptionMedia(UUID, boolean, Set)
- */
@Override
public int countTaxonDescriptionMedia(UUID taxonUuid, boolean limitToGalleries, Set<MarkerType> markerTypes){
return this.dao.countTaxonDescriptionMedia(taxonUuid, limitToGalleries, markerTypes);
}
-
-
-
@Override
+ @Deprecated
public DistributionTree getOrderedDistributions(
Set<TaxonDescription> taxonDescriptions,
- Set<NamedAreaLevel> omitLevels,
- List<String> propertyPaths){
+ boolean subAreaPreference,
+ boolean statusOrderPreference,
+ Set<MarkerType> hiddenAreaMarkerTypes,
+ Set<NamedAreaLevel> omitLevels, List<String> propertyPaths){
- DistributionTree tree = new DistributionTree();
List<Distribution> distList = new ArrayList<Distribution>();
+ List<UUID> uuids = new ArrayList<UUID>();
for (TaxonDescription taxonDescription : taxonDescriptions) {
- taxonDescription = (TaxonDescription) dao.load(taxonDescription.getUuid(), propertyPaths);
- Set<DescriptionElementBase> elements = taxonDescription.getElements();
- for (DescriptionElementBase element : elements) {
- if (element.isInstanceOf(Distribution.class)) {
- Distribution distribution = (Distribution) element;
- if(distribution.getArea() != null){
- distList.add(distribution);
+ if (! taxonDescription.isImageGallery()){ //image galleries should not have descriptions, but better filter fully on DTYPE of description element
+ uuids.add(taxonDescription.getUuid());
+ }
+ }
+
+ List<DescriptionBase> desclist = dao.list(uuids, null, null, null, propertyPaths);
+ for (DescriptionBase desc : desclist) {
+ if (desc.isInstanceOf(TaxonDescription.class)){
+ Set<DescriptionElementBase> elements = desc.getElements();
+ for (DescriptionElementBase element : elements) {
+ if (element.isInstanceOf(Distribution.class)) {
+ Distribution distribution = (Distribution) element;
+ if(distribution.getArea() != null){
+ distList.add(distribution);
+ }
}
- }
+ }
}
}
+ //old
+// for (TaxonDescription taxonDescription : taxonDescriptions) {
+// if (logger.isDebugEnabled()){ logger.debug("load taxon description " + taxonDescription.getUuid());}
+// //TODO why not loading all description via .list ? This may improve performance
+// taxonDescription = (TaxonDescription) dao.load(taxonDescription.getUuid(), propertyPaths);
+// Set<DescriptionElementBase> elements = taxonDescription.getElements();
+// for (DescriptionElementBase element : elements) {
+// if (element.isInstanceOf(Distribution.class)) {
+// Distribution distribution = (Distribution) element;
+// if(distribution.getArea() != null){
+// distList.add(distribution);
+// }
+// }
+// }
+// }
+
+ if (logger.isDebugEnabled()){logger.debug("filter tree for " + distList.size() + " distributions ...");}
+
// filter distributions
- Collection<Distribution> filteredDistributions = DescriptionUtility.filterDistributions(distList);
+ Collection<Distribution> filteredDistributions = DescriptionUtility.filterDistributions(distList, hiddenAreaMarkerTypes, true, statusOrderPreference, false);
distList.clear();
distList.addAll(filteredDistributions);
- //order by areas
- tree.orderAsTree(distList, omitLevels);
- tree.sortChildren();
- return tree;
+ return DescriptionUtility.orderDistributions(definedTermDao, omitLevels, distList, hiddenAreaMarkerTypes, null);
}
+
@Override
public Pager<TaxonNameDescription> getTaxonNameDescriptions(TaxonNameBase name, Integer pageSize, Integer pageNumber, List<String> propertyPaths) {
Integer numberOfResults = dao.countTaxonNameDescriptions(name);
* Rename: searchByDistribution
*/
@Override
- public Pager<TaxonDescription> searchDescriptionByDistribution(Set<NamedArea> namedAreas, PresenceAbsenceTermBase presence, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
+ public Pager<TaxonDescription> searchDescriptionByDistribution(Set<NamedArea> namedAreas, PresenceAbsenceTerm presence, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths) {
Integer numberOfResults = dao.countDescriptionByDistribution(namedAreas, presence);
List<TaxonDescription> results = new ArrayList<TaxonDescription>();
@Override
@Transactional(readOnly = false)
public UUID saveDescriptionElement(DescriptionElementBase descriptionElement) {
- return descriptionElementDao.save(descriptionElement);
+ return descriptionElementDao.save(descriptionElement).getUuid();
}
/**
return descriptionElementDao.delete(descriptionElement);
}
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#deleteDescriptionElement(java.util.UUID)
+ */
+ @Override
+ public UUID deleteDescriptionElement(UUID descriptionElementUuid) {
+ return deleteDescriptionElement(descriptionElementDao.load(descriptionElementUuid));
+ }
+
+ @Override
+ @Transactional(readOnly = false)
+ public DeleteResult deleteDescription(DescriptionBase description) {
+ DeleteResult deleteResult = new DeleteResult();
+
+ if (description instanceof TaxonDescription){
+ TaxonDescription taxDescription = HibernateProxyHelper.deproxy(description, TaxonDescription.class);
+ Taxon tax = taxDescription.getTaxon();
+ tax.removeDescription(taxDescription, true);
+ dao.delete(description);
+
+ deleteResult.addUpdatedObject(tax);
+ deleteResult.setCdmEntity(tax);
+ }
+
+
+ return deleteResult;
+ }
+
+
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.cdm.api.service.IDescriptionService#deleteDescription(java.util.UUID)
+ */
+ @Override
+ @Transactional(readOnly = false)
+ public DeleteResult deleteDescription(UUID descriptionUuid) {
+ return deleteDescription(dao.load(descriptionUuid));
+ }
+
+
@Override
public TermVocabulary<Feature> getFeatureVocabulary(UUID uuid) {
return vocabularyDao.findByUuid(uuid);
Taxon taxon, Set<Feature> features,
Class<T> type, Integer pageSize,
Integer pageNumber, List<String> propertyPaths) {
- return dao.getDescriptionElementForTaxon(taxon, features, type, pageSize, pageNumber, propertyPaths);
+ return dao.getDescriptionElementForTaxon(taxon.getUuid(), features, type, pageSize, pageNumber, propertyPaths);
}
@Override
Taxon taxon, Set<Feature> features,
Class<T> type, Integer pageSize,
Integer pageNumber, List<String> propertyPaths) {
- Long count = dao.countDescriptionElementForTaxon(taxon, features, type);
+ if (logger.isDebugEnabled()){logger.debug(" get count ...");}
+ Long count = dao.countDescriptionElementForTaxon(taxon.getUuid(), features, type);
List<T> descriptionElements;
- if(count > (pageSize * pageNumber + 1)){ // no point checking again
+ if(AbstractPagerImpl.hasResultsInRange(count, pageNumber, pageSize)){ // no point checking again
+ if (logger.isDebugEnabled()){logger.debug(" get list ...");}
descriptionElements = listDescriptionElementsForTaxon(taxon, features, type, pageSize, pageNumber, propertyPaths);
} else {
descriptionElements = new ArrayList<T>(0);
}
+ if (logger.isDebugEnabled()){logger.debug(" service - DONE ...");}
return new DefaultPagerImpl<T>(pageNumber, count.intValue(), pageSize, descriptionElements);
}
return naturalLanguageDescription.toString();
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IDescriptionService#hasStructuredData(eu.etaxonomy.cdm.model.description.DescriptionBase)
- */
+
@Override
public boolean hasStructuredData(DescriptionBase<?> description) {
return load(description.getUuid()).hasStructuredData();
}
- /* (non-Javadoc)
- * @see eu.etaxonomy.cdm.api.service.IDescriptionService#moveDescriptionElementsToDescription(java.util.Collection, eu.etaxonomy.cdm.model.description.DescriptionBase, boolean)
- */
@Override
- public void moveDescriptionElementsToDescription(Collection<DescriptionElementBase> descriptionElements,
- DescriptionBase targetDescription, boolean isCopy) {
+ @Transactional(readOnly = false)
+ public UpdateResult moveDescriptionElementsToDescription(
+ Collection<DescriptionElementBase> descriptionElements,
+ DescriptionBase targetDescription,
+ boolean isCopy) {
+ UpdateResult result = new UpdateResult();
if (descriptionElements.isEmpty() ){
- return ;
+ return result;
}
if (! isCopy && descriptionElements == descriptionElements.iterator().next().getInDescription().getElements()){
// descriptionElements = descriptionElementsTmp;
}
for (DescriptionElementBase element : descriptionElements){
- DescriptionBase description = element.getInDescription();
+ DescriptionBase<?> description = element.getInDescription();
try {
DescriptionElementBase newElement = (DescriptionElementBase)element.clone();
targetDescription.addElement(newElement);
} catch (CloneNotSupportedException e) {
- new RuntimeException ("Clone not yet implemented for class " + element.getClass().getName(), e);
+ throw new RuntimeException ("Clone not yet implemented for class " + element.getClass().getName(), e);
}
if (! isCopy){
description.removeElement(element);
+ if (description.getElements().isEmpty()){
+ if (description instanceof TaxonDescription){
+ TaxonDescription taxDescription = HibernateProxyHelper.deproxy(description, TaxonDescription.class);
+ if (taxDescription.getTaxon() != null){
+ taxDescription.getTaxon().removeDescription((TaxonDescription)description);
+ }
+ }
+ dao.delete(description);
+ }else{
+ dao.saveOrUpdate(description);
+ result.addUpdatedObject(description);
+ }
}
+
+ }
+ dao.saveOrUpdate(targetDescription);
+ result.addUpdatedObject(targetDescription);
+ if (targetDescription instanceof TaxonDescription){
+ result.addUpdatedObject(((TaxonDescription)targetDescription).getTaxon());
}
+ return result;
}
- public void aggregateDistributions(List<NamedArea> superAreas, Rank lowerRank, Rank upperRank) {
+ @Override
+ @Transactional(readOnly = false)
+ public UpdateResult moveDescriptionElementsToDescription(
+ Set<UUID> descriptionElementUUIDs,
+ UUID targetDescriptionUuid,
+ boolean isCopy) {
+ Set<DescriptionElementBase> descriptionElements = new HashSet<DescriptionElementBase>();
+ for(UUID deUuid : descriptionElementUUIDs) {
+ descriptionElements.add(descriptionElementDao.load(deUuid));
+ }
+ DescriptionBase targetDescription = dao.load(targetDescriptionUuid);
+
+ return moveDescriptionElementsToDescription(descriptionElements, targetDescription, isCopy);
+ }
-// transmissionEngineDistribution engine = new transmissionEngineDistribution(superAreas, lowerRank, upperRank);
+ @Override
+ @Transactional(readOnly = false)
+ public UpdateResult moveDescriptionElementsToDescription(
+ Set<UUID> descriptionElementUUIDs,
+ UUID targetTaxonUuid,
+ String moveMessage,
+ boolean isCopy) {
+ Taxon targetTaxon = CdmBase.deproxy(taxonDao.load(targetTaxonUuid), Taxon.class);
+ DescriptionBase targetDescription = TaxonDescription.NewInstance(targetTaxon);
+ targetDescription.setTitleCache(moveMessage, true);
+ Annotation annotation = Annotation.NewInstance(moveMessage, Language.getDefaultLanguage());
+ annotation.setAnnotationType(AnnotationType.TECHNICAL());
+ targetDescription.addAnnotation(annotation);
+
+ targetDescription = dao.save(targetDescription);
+ Set<DescriptionElementBase> descriptionElements = new HashSet<DescriptionElementBase>();
+ for(UUID deUuid : descriptionElementUUIDs) {
+ descriptionElements.add(descriptionElementDao.load(deUuid));
+ }
+
+ return moveDescriptionElementsToDescription(descriptionElements, targetDescription, isCopy);
+ }
+
+ @Override
+ public Pager<TermDto> pageNamedAreasInUse(boolean includeAllParents, Integer pageSize,
+ Integer pageNumber){
+ List<TermDto> results = dao.listNamedAreasInUse(includeAllParents, null, null);
+ int startIndex= pageNumber * pageSize;
+ int toIndex = Math.min(startIndex + pageSize, results.size());
+ List<TermDto> page = results.subList(startIndex, toIndex);
+ return new DefaultPagerImpl<TermDto>(pageNumber, results.size(), pageSize, page);
+ }
+
+
+ @Override
+ @Transactional(readOnly = false)
+ public UpdateResult moveTaxonDescriptions(Taxon sourceTaxon, Taxon targetTaxon) {
+ List<TaxonDescription> descriptions = new ArrayList(sourceTaxon.getDescriptions());
+ UpdateResult result = new UpdateResult();
+ result.addUpdatedObject(sourceTaxon);
+ result.addUpdatedObject(targetTaxon);
+ for(TaxonDescription description : descriptions){
+
+ String moveMessage = String.format("Description moved from %s", sourceTaxon);
+ if(description.isProtectedTitleCache()){
+ String separator = "";
+ if(!StringUtils.isBlank(description.getTitleCache())){
+ separator = " - ";
+ }
+ description.setTitleCache(description.getTitleCache() + separator + moveMessage, true);
+ }
+ Annotation annotation = Annotation.NewInstance(moveMessage, Language.getDefaultLanguage());
+ annotation.setAnnotationType(AnnotationType.TECHNICAL());
+ description.addAnnotation(annotation);
+ targetTaxon.addDescription(description);
+ }
+ return result;
+ }
+
+ @Override
+ @Transactional(readOnly = false)
+ public UpdateResult moveTaxonDescriptions(UUID sourceTaxonUuid, UUID targetTaxonUuid) {
+ Taxon sourceTaxon = HibernateProxyHelper.deproxy(taxonDao.load(sourceTaxonUuid), Taxon.class);
+ Taxon targetTaxon = HibernateProxyHelper.deproxy(taxonDao.load(targetTaxonUuid), Taxon.class);
+ return moveTaxonDescriptions(sourceTaxon, targetTaxon);
+
+ }
+
+ @Override
+ @Transactional(readOnly = false)
+ public UpdateResult moveTaxonDescription(UUID descriptionUuid, UUID targetTaxonUuid){
+ UpdateResult result = new UpdateResult();
+ TaxonDescription description = HibernateProxyHelper.deproxy(dao.load(descriptionUuid), TaxonDescription.class);
+
+ Taxon sourceTaxon = description.getTaxon();
+ String moveMessage = String.format("Description moved from %s", sourceTaxon);
+ if(description.isProtectedTitleCache()){
+ String separator = "";
+ if(!StringUtils.isBlank(description.getTitleCache())){
+ separator = " - ";
+ }
+ description.setTitleCache(description.getTitleCache() + separator + moveMessage, true);
+ }
+ Annotation annotation = Annotation.NewInstance(moveMessage, Language.getDefaultLanguage());
+ annotation.setAnnotationType(AnnotationType.TECHNICAL());
+ description.addAnnotation(annotation);
+ Taxon targetTaxon = HibernateProxyHelper.deproxy(taxonDao.load(targetTaxonUuid), Taxon.class);
+ targetTaxon.addDescription(description);
+ result.addUpdatedObject(targetTaxon);
+ result.addUpdatedObject(sourceTaxon);
+ // dao.merge(description);
+ return result;
}