Project

General

Profile

Revision 0829c6d4

ID0829c6d476a25005a2b82ae53b29d8124a93aae7
Parent 96646c31

Added by Katja Luther almost 7 years ago

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/taxon/Classification.java
174 174
	public boolean deleteChildNode(TaxonNode node, boolean deleteChildren) {
175 175
		boolean result = removeChildNode(node);
176 176
		
177
		node.getTaxon().removeTaxonNode(node);
177
		//node.getTaxon().removeTaxonNode(node);
178 178
		node.setTaxon(null);	
179 179
		if (deleteChildren){
180 180
			ArrayList<TaxonNode> childNodes = new ArrayList<TaxonNode>(node.getChildNodes()); 
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonServiceImpl.java
1028 1028
                try {
1029 1029
                	TaxonNameBase name = nameService.find(taxon.getName().getUuid());
1030 1030
                	name = (TaxonNameBase)HibernateProxyHelper.deproxy(name);
1031
                	name.removeTaxonBase(taxon);
1032
                	nameService.save(name);
1033
                	
1034
                    nameService.delete(name, config.getNameDeletionConfig());
1031
                	//check whether taxon will be deleted or not
1032
                	if (taxon.getTaxonNodes() == null || taxon.getTaxonNodes().size()== 0){
1033
                		name.removeTaxonBase(taxon);
1034
                	    nameService.save(name);
1035
                		nameService.delete(name, config.getNameDeletionConfig());
1036
                	}
1035 1037
                } catch (ReferencedObjectUndeletableException e) {
1036 1038
                    //do nothing
1037 1039
                    if (logger.isDebugEnabled()){logger.debug("Name could not be deleted");}
......
1060 1062
            	dao.delete(taxon);
1061 1063
            } else{
1062 1064
            	message = "Taxon can't be deleted as it is used in another Taxonnode";
1063
            	 //do nothing
1064
                if (logger.isDebugEnabled()){logger.debug(message);}
1065
            	throw new ReferencedObjectUndeletableException(message);
1065 1066
            }
1066 1067
            
1067 1068

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)