Project

General

Profile

Revision 0196a8bf

ID0196a8bf3714fafc53be64b37f26ed90a8542d93
Parent 489923b4
Child fbc64294

Added by Patrick Plitzner about 3 years ago

ref #6694 Fix moving of feature nodes

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/FeatureNodeServiceImpl.java
123 123
    @Override
124 124
    public UpdateResult moveFeatureNode(UUID movedNodeUuid, UUID targetNodeUuid, int position) {
125 125
        UpdateResult result = new UpdateResult();
126
        FeatureNode movedNode = HibernateProxyHelper.deproxy(dao.load(movedNodeUuid), FeatureNode.class);
127
        FeatureNode targetNode = HibernateProxyHelper.deproxy(dao.load(targetNodeUuid), FeatureNode.class);
126
        FeatureNode movedNode = HibernateProxyHelper.deproxy(load(movedNodeUuid), FeatureNode.class);
127
        FeatureNode targetNode = HibernateProxyHelper.deproxy(load(targetNodeUuid), FeatureNode.class);
128
        FeatureNode parent = HibernateProxyHelper.deproxy(movedNode.getParent(), FeatureNode.class);
128 129
        if(position<0){
129 130
            targetNode.addChild(movedNode);
130 131
        }
......
132 133
            targetNode.addChild(movedNode, position);
133 134
        }
134 135
        result.addUpdatedObject(targetNode);
135
        if(movedNode.getParent()!=null){
136
            result.addUpdatedObject(movedNode.getParent());
136
        saveOrUpdate(targetNode);
137
        saveOrUpdate(movedNode);
138
        if(parent!=null){
139
            result.addUpdatedObject(parent);
140
            saveOrUpdate(parent);
137 141
        }
138 142
        result.setCdmEntity(targetNode.getFeatureTree());
139 143
        return result;

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)