Project

General

Profile

Revision 69f6fe4f

ID69f6fe4fbab38c02c9d3c0319b04aaeea7b667a6
Parent 4ce7e0da
Child b5dbd2f6

Added by Patrick Plitzner over 3 years ago

ref #7362 Add service method which also saves the new feature

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/FeatureNodeServiceImpl.java
24 24
import eu.etaxonomy.cdm.api.service.exception.ReferencedObjectUndeletableException;
25 25
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
26 26
import eu.etaxonomy.cdm.model.common.CdmBase;
27
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
27 28
import eu.etaxonomy.cdm.model.description.Feature;
28 29
import eu.etaxonomy.cdm.model.description.FeatureNode;
29 30
import eu.etaxonomy.cdm.model.description.FeatureTree;
......
100 101
	 }
101 102

  
102 103
	 @Override
104
	 public UpdateResult createChildFeatureNode(FeatureNode node, Feature featureChild){
105
	     DefinedTermBase feature = termService.save(featureChild);
106
	     FeatureNode childNode = FeatureNode.NewInstance(featureChild);
107
	     save(childNode);
108
	     UpdateResult result = new UpdateResult();
109
	     node.addChild(childNode);
110
	     result.addUpdatedObject(node);
111
	     result.setCdmEntity(node.getFeatureTree());
112
	     return result;
113
	 }
114

  
115
	 @Override
103 116
	 public UpdateResult addChildFeatureNode(FeatureNode node, Feature featureChild){
104 117
	     UpdateResult result = new UpdateResult();
105 118
	     FeatureNode childNode = FeatureNode.NewInstance(featureChild);
106 119
	     node.addChild(childNode);
107 120
	     result.addUpdatedObject(node);
121
	     result.setCdmEntity(node.getFeatureTree());
108 122
	     return result;
109 123
	 }
110 124

  
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IFeatureNodeService.java
46 46
     */
47 47
    public UpdateResult addChildFeatureNode(FeatureNode parentNode, Feature featureChild);
48 48

  
49

  
50
    /**
51
     * Creates, saves and adds the specified feature as a child node to the given feature node
52
     * @param parentNode the feature node where the new feature should be added
53
     * @param featureChild the feature which should be added to the given feature node
54
     * @return the result of the operation
55
     */
56
    public UpdateResult createChildFeatureNode(FeatureNode node, Feature featureChild);
57

  
49 58
    /**
50 59
     * Adds the specified feature as a child node to the given feature node
51 60
     * @param parentNodeUUID the UUID of the feature node where the new feature should be added

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)