Add propertyPath to service method
authorPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 30 May 2017 10:47:17 +0000 (12:47 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Tue, 30 May 2017 11:49:08 +0000 (13:49 +0200)
cdmlib-ext/src/main/java/eu/etaxonomy/cdm/ext/geo/EditGeoServiceUtilities.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/common/ITermVocabularyDao.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/TermVocabularyDaoImpl.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IVocabularyService.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/VocabularyServiceImpl.java
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/VocabularyServiceImplTest.java

index 39714a3ae0e09a263b3ebc4e071a709711fc88b9..da05b18a8e4b67e4a4a2d60558f6c0300c5949e5 100644 (file)
@@ -710,7 +710,7 @@ public class EditGeoServiceUtilities {
             uuids.add(presenceTermVocabUuid);\r
 \r
 \r
-            for(TermVocabulary vocab : vocabularyService.findByTermType(TermType.PresenceAbsenceTerm)) {\r
+            for(TermVocabulary vocab : vocabularyService.findByTermType(TermType.PresenceAbsenceTerm, null)) {\r
                 if(!uuids.contains(vocab.getUuid())) {\r
                     uuids.add(vocab.getUuid());\r
                 }\r
index e3f27e937897367802f43051cf0a715eae3e62ad..88d23e62c1f5015ddcdc71fcd1e590b7625bff61 100644 (file)
@@ -66,9 +66,10 @@ public interface ITermVocabularyDao extends IIdentifiableDao<TermVocabulary> {
      * Return a List of vocabularies that belong to the term type supplied
      *
      * @param termType The term type corresponding to the vocabularies of interest
+     * @param propertyPaths
      * @return a List of vocabularies
      */
-    public <T extends DefinedTermBase> List<TermVocabulary<T>> findByTermType(TermType termType);
+    public <T extends DefinedTermBase> List<TermVocabulary<T>> findByTermType(TermType termType, List<String> propertyPaths);
 
 
        /**
index f35f07a3af05caa5afb3bdfd182e4cf3341aa307..e3947656bc86ae75b5b2d77d4b4ec57a81132592 100644 (file)
@@ -122,7 +122,7 @@ public class TermVocabularyDaoImpl extends IdentifiableDaoBase<TermVocabulary> i
 
 
     @Override
-    public <T extends DefinedTermBase> List<TermVocabulary<T>> findByTermType(TermType termType) {
+    public <T extends DefinedTermBase> List<TermVocabulary<T>> findByTermType(TermType termType, List<String> propertyPaths) {
 
         Criteria criteria = getSession().createCriteria(type);
         criteria.add(Restrictions.eq("termType", termType));
@@ -130,7 +130,7 @@ public class TermVocabularyDaoImpl extends IdentifiableDaoBase<TermVocabulary> i
         //this.addOrder(criteria, orderHints);
 
         List<TermVocabulary<T>> result = criteria.list();
-        defaultBeanInitializer.initializeAll(result, null);
+        defaultBeanInitializer.initializeAll(result, propertyPaths);
         return result;
     }
 
index 8516ad53d1778457971e9f2fa01d9529e9fd50fd..e875c999f941a32c0ddb585e1f72b048249ba1ca 100644 (file)
@@ -66,6 +66,6 @@ public interface IVocabularyService extends IIdentifiableEntityService<TermVocab
         * @param termType The term type for which the list of vocabularies is desired
         * @return a list of vocabularies
         */
-       public <T extends DefinedTermBase> List<TermVocabulary<T>> findByTermType(TermType termType);
+       public <T extends DefinedTermBase> List<TermVocabulary<T>> findByTermType(TermType termType, List<String> propertyPaths);
 
 }
index 910e88311c97f7a99bf1b9ac3537ed20d8d3df6a..8e9180371100748082ce25e2153c5eb1bc43b158 100644 (file)
@@ -56,8 +56,8 @@ public class VocabularyServiceImpl extends IdentifiableServiceBase<TermVocabular
     }
 
     @Override
-       public <T extends DefinedTermBase> List<TermVocabulary<T>> findByTermType(TermType termType) {
-               return dao.findByTermType(termType);
+       public <T extends DefinedTermBase> List<TermVocabulary<T>> findByTermType(TermType termType, List<String> propertyPaths) {
+               return dao.findByTermType(termType, propertyPaths);
        }
        /**
         * (non-Javadoc)
index cc3f1e70ffec72423d3fc3f5d154afd54085a2e5..701ee3c760f78465baf3a1bbfb44bd1198267e5d 100644 (file)
@@ -50,7 +50,7 @@ public class VocabularyServiceImplTest extends CdmTransactionalIntegrationTest{
     @Test
 //    @Ignore //FIXME assertSame does not work yet
     public void testGetRankVocabulary() {
-        List<TermVocabulary<Rank>> rankVocabularyList = vocabularyService.findByTermType(TermType.Rank);
+        List<TermVocabulary<Rank>> rankVocabularyList = vocabularyService.findByTermType(TermType.Rank, null);
         assertTrue(rankVocabularyList.size() == 1);
         OrderedTermVocabulary<Rank> rankVocabulary = (OrderedTermVocabulary<Rank>)rankVocabularyList.get(0);
         assertNotNull(rankVocabulary);
@@ -69,7 +69,7 @@ public class VocabularyServiceImplTest extends CdmTransactionalIntegrationTest{
 //    @Ignore  //not yet correctly implemented
     public void testGetTypeDesignationVocabulary() {
         List<TermVocabulary<SpecimenTypeDesignationStatus>> typeDesignationVocabularyList =
-                       vocabularyService.findByTermType(TermType.SpecimenTypeDesignationStatus);
+                       vocabularyService.findByTermType(TermType.SpecimenTypeDesignationStatus, null);
         assertTrue(typeDesignationVocabularyList.size() == 1);
         OrderedTermVocabulary<SpecimenTypeDesignationStatus> typeDesignationVocabulary = (OrderedTermVocabulary<SpecimenTypeDesignationStatus>)typeDesignationVocabularyList.get(0);