Project

General

Profile

Revision 0de43613

ID0de43613409c826f25120f9c90dcb1fe98334355
Parent a8b0ad5f
Child e111542f

Added by Katja Luther almost 3 years ago

move taxonnode needs to save old parent and child node

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/TaxonNodeServiceImpl.java
589 589
        UpdateResult result = new UpdateResult();
590 590

  
591 591
        TaxonNode parentParent = HibernateProxyHelper.deproxy(newParent.getParent(), TaxonNode.class);
592

  
592
        TaxonNode oldParent = HibernateProxyHelper.deproxy(taxonNode.getParent(), TaxonNode.class);
593 593
        Integer sortIndex = -1;
594 594
        if (movingType == 0){
595 595
            sortIndex = 0;
......
607 607
        result.addUpdatedObject(taxonNode.getParent());
608 608
        result.setCdmEntity(taxonNode);
609 609

  
610
        newParent.addChildNode(taxonNode, sortIndex, taxonNode.getReference(),  taxonNode.getMicroReference());
610
        taxonNode = newParent.addChildNode(taxonNode, sortIndex, taxonNode.getReference(),  taxonNode.getMicroReference());
611 611

  
612
        dao.saveOrUpdate(newParent);
612
        dao.saveOrUpdate(taxonNode);
613
        dao.saveOrUpdate(oldParent);
613 614

  
614 615
        return result;
615 616
    }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)