Deprecate getCharacterData method in service layer
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / FeatureTreeServiceImpl.java
index 6a6e1fea34b3e686387484e6bc816b3474e68196..6a7a1ce77af3c16c7c5021887665a85d835bf93a 100644 (file)
@@ -15,6 +15,8 @@ import java.util.List;
 import java.util.Map;\r
 import java.util.UUID;\r
 \r
+import javax.persistence.EntityNotFoundException;\r
+\r
 import org.springframework.beans.factory.annotation.Autowired;\r
 import org.springframework.stereotype.Service;\r
 import org.springframework.transaction.annotation.Transactional;\r
@@ -106,7 +108,10 @@ public class FeatureTreeServiceImpl extends IdentifiableServiceBase<FeatureTree,
         }\r
 \r
         FeatureTree featureTree = load(uuid, rootPaths);\r
-        dao.loadNodes(featureTree.getRoot(),nodePaths);\r
+        if(featureTree == null){\r
+            throw new EntityNotFoundException("No FeatureTree entity found for " + uuid);\r
+        }\r
+        dao.deepLoadNodes(featureTree.getRoot().getChildNodes() ,nodePaths);\r
         return featureTree;\r
     }\r
 \r