Project

General

Profile

Revision d8866c51

IDd8866c51c7e27907c06d625c9b0412ce53178326
Parent 9fd9e5af
Child 6fa26b36

Added by Katja Luther over 3 years ago

minor

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dto/TaxonNodeDto.java
69 69

  
70 70
    private final UUID classificationUUID;
71 71

  
72

  
73

  
72 74
    private final UUID parentUUID;
73 75

  
74 76
    private final String treeIndex;
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/ClassificationServiceImpl.java
688 688
            return result;
689 689
        }
690 690
        if (config.getTaxonNodeConfig().getChildHandling().equals(ChildHandling.DELETE)){
691
            TaxonNode root = classification.getRootNode();
692
            result.includeResult(taxonNodeService.deleteTaxonNode(root, config));
691
//            TaxonNode root = classification.getRootNode();
692
//            result.includeResult(taxonNodeService.deleteTaxonNode(HibernateProxyHelper.deproxy(root), config));
693
//            result.addDeletedObject(classification);
693 694
            dao.delete(classification);
694 695
            result.addDeletedObject(classification);
695

  
696
            return result;
696 697
        }
697 698

  
698 699

  
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonNodeServiceImpl.java
621 621
        	}
622 622
    	}
623 623
    	result.setCdmEntity(node);
624
    	boolean success = taxon.removeTaxonNode(node);
624
    	boolean success = true;
625
    	if (taxon != null){
626
    	    success = taxon.removeTaxonNode(node);
627
    	    taxonService.saveOrUpdate(taxon);
628
    	}
625 629
    	dao.saveOrUpdate(parent);
626
    	taxonService.saveOrUpdate(taxon);
630

  
627 631
    	result.addUpdatedObject(parent);
628 632

  
629 633
    	if (success){
630 634
			result.setStatus(Status.OK);
631
			parent = HibernateProxyHelper.deproxy(parent, TaxonNode.class);
632
			int index = parent.getChildNodes().indexOf(node);
633
			if (index > -1){
634
			    parent.removeChild(index);
635
			if (parent != null){
636
    			parent = HibernateProxyHelper.deproxy(parent, TaxonNode.class);
637
    			int index = parent.getChildNodes().indexOf(node);
638
    			if (index > -1){
639
    			    parent.removeChild(index);
640
    			}
635 641
			}
636 642
    		if (!dao.delete(node, config.getTaxonNodeConfig().getChildHandling().equals(ChildHandling.DELETE)).equals(null)){
643
    		    result.getUpdatedObjects().remove(node);
637 644
    			result.addDeletedObject(node);
638 645
    			return result;
639 646
    		} else {

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)