adapt uuidAndTitleCache services and dao methods to search for a pattern
authorKatja Luther <k.luther@bgbm.org>
Thu, 30 Nov 2017 10:52:46 +0000 (11:52 +0100)
committerKatja Luther <k.luther@bgbm.org>
Thu, 30 Nov 2017 10:55:57 +0000 (11:55 +0100)
15 files changed:
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/agent/IAgentDao.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/common/IAnnotatableDao.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/common/IIdentifiableDao.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/agent/AgentDaoImpl.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/AnnotatableDaoImpl.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/IdentifiableDaoBase.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/molecular/AmplificationDaoHibernateImpl.java
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/molecular/IAmplificationDao.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/AgentServiceImpl.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/AnnotatableServiceBase.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IAgentService.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IAnnotatableService.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IIdentifiableEntityService.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/molecular/AmplificationServiceImpl.java
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/molecular/IAmplificationService.java

index e98faf85a998e52732e4d8d7b74d6ada979e2652..0374d2174a7dd81da81c150d72fa88effe1c0d8c 100644 (file)
@@ -104,7 +104,7 @@ public interface IAgentDao extends IIdentifiableDao<AgentBase> {
        /**
         * @return
         */
-       public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache();
+       public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache(Integer limit, String pattern);
 
     /**
      * @param limit
index 15fb5d4963c7e5b8c291da4c839c9639304117c4..d21010c8f3af64d728c4557f1715b7d0771746af 100644 (file)
@@ -1,8 +1,8 @@
 /**
 * Copyright (C) 2007 EDIT
-* European Distributed Institute of Taxonomy 
+* European Distributed Institute of Taxonomy
 * http://www.e-taxonomy.eu
-* 
+*
 * The contents of this file are subject to the Mozilla Public License Version 1.1
 * See LICENSE.TXT at the top of this package for the full license terms.
 */
@@ -13,9 +13,10 @@ import java.util.List;
 
 import eu.etaxonomy.cdm.model.common.AnnotatableEntity;
 import eu.etaxonomy.cdm.model.common.Annotation;
-import eu.etaxonomy.cdm.model.common.MarkerType;
 import eu.etaxonomy.cdm.model.common.Marker;
+import eu.etaxonomy.cdm.model.common.MarkerType;
 import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
+import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.query.OrderHint;
 
 /**
@@ -24,10 +25,10 @@ import eu.etaxonomy.cdm.persistence.query.OrderHint;
  * @version 1.0
  */
 public interface IAnnotatableDao<T extends AnnotatableEntity> extends IVersionableDao<T>{
-       
+
        /**
         * Returns a List of Annotations belonging to the supplied AnnotatableEntity
-        * 
+        *
         * @param annotatableEntity the entity which is annotated
         * @param status The status of the annotations (null to return annotations regardless of status)
         * @param pageSize The maximum number of annotations returned (can be null for all annotations)
@@ -37,27 +38,27 @@ public interface IAnnotatableDao<T extends AnnotatableEntity> extends IVersionab
         * @return a List of Annotation instances
         */
     public List<Annotation> getAnnotations(T annotatableEntity, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
-       
+
     /**
         * Returns a count of Annotations belonging to the supplied AnnotatableEntity
-        * 
+        *
         * @param annotatableEntity the entity which is annotated
         * @param status The status of the annotations (null to count all annotations regardless of status)
         * @return a count of Annotation instances
         */
        public int countAnnotations(T annotatableEntity, MarkerType status);
-       
+
        /**
-        * Returns a count of Markers belonging to the supplied AnnotatableEntity 
-        * 
+        * Returns a count of Markers belonging to the supplied AnnotatableEntity
+        *
         * @param annotatableEntity the entity which is marked
         * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
         * @return a count of Marker instances
         */
        public int countMarkers(T annotatableEntity, Boolean technical);
-       
+
        /**
-        * 
+        *
         * @param annotatableEntity the entity which is marked
         * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
         * @param pageSize The maximum number of markers returned (can be null for all markers)
@@ -68,11 +69,11 @@ public interface IAnnotatableDao<T extends AnnotatableEntity> extends IVersionab
         */
        public List<Marker> getMarkers(T annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
        /**
-        * Returns a list of arrays representing counts of entities of type clazz, grouped by their markerTypes. The arrays have two elements. 
+        * Returns a list of arrays representing counts of entities of type clazz, grouped by their markerTypes. The arrays have two elements.
         * The first element is the MarkerType, initialized using the propertyPaths parameter. The second element is the count of all markers of Objects
         * of type clazz with that MarkerType. The boolean technical can be used to choose only technical or only non-technical marker types. The list is sorted by
         * titleCache of the markerType, in ascending order.
-        * 
+        *
         * @param clazz optionally restrict the markers to those belonging to this class
         * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
         * @param pageSize The maximum number of arrays returned (can be null for all arrays)
@@ -81,13 +82,47 @@ public interface IAnnotatableDao<T extends AnnotatableEntity> extends IVersionab
         * @return
         */
        public List<Object[]> groupMarkers(Class<? extends T> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
-       
+
        /**
         * returns a count of all markers belonging to that clazz, optionally filtered to include only technical or only non-technical markers.
-        * 
+        *
         * @param clazz optionally restrict the markers to those belonging to this class
         * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
         * @return a count of markers
         */
        public int countMarkers(Class<? extends T> clazz, Boolean technical);
+
+    /**
+     * Return a list of all uuids mapped to titleCache in the convenient <code>UuidAndTitleCache</code> object.
+     * Retrieving this list is considered to be significantly faster than initializing the fully fledged buiseness
+     * objects. To be used in cases where you want to present large amount of data and provide details after
+     * a selection has been made.
+     *
+     * @return a list of <code>UuidAndTitleCache</code> instances
+     * @see #getUuidAndTitleCache(Class, Integer, String)
+     */
+    public List<UuidAndTitleCache<T>> getUuidAndTitleCache(Integer limit, String pattern);
+
+    /**
+     * Like {@link #getUuidAndTitleCache(Integer, String)} but searching only on a subclass
+     * of the type handled by the DAO.
+     *
+     * @param clazz the (sub)class
+     * @param limit max number of results
+     * @param pattern search pattern
+
+     * @see #getUuidAndTitleCache(Integer, String)
+     */
+    public <S extends T> List<UuidAndTitleCache<S>> getUuidAndTitleCache(Class<S> clazz, Integer limit, String pattern);
+
+
+    /**
+     * Return a list of all uuids mapped to titleCache in the convenient <code>UuidAndTitleCache</code> object.
+     * Retrieving this list is considered to be significantly faster than initializing the fully fledged buiseness
+     * objects. To be used in cases where you want to present large amount of data and provide details after
+     * a selection has been made.
+     *
+     * @return a list of <code>UuidAndTitleCache</code> instances
+     */
+    public List<UuidAndTitleCache<T>> getUuidAndTitleCache();
 }
index 18f3b23a0eee61bba001148b43cefbcb7371329e..09a4f62061e3b21c01ec998340147f875e051517 100644 (file)
@@ -22,7 +22,6 @@ import eu.etaxonomy.cdm.model.common.LSID;
 import eu.etaxonomy.cdm.model.common.MarkerType;
 import eu.etaxonomy.cdm.model.media.Rights;
 import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
-import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.query.MatchMode;
 import eu.etaxonomy.cdm.persistence.query.OrderHint;
 
@@ -85,39 +84,7 @@ public interface IIdentifiableDao <T extends IdentifiableEntity> extends IAnnota
        // TODO Migrated from IOriginalSourceDao
        public List<T> findOriginalSourceByIdInSource(String idInSource, String idNamespace);
 
-       /**
-        * Return a list of all uuids mapped to titleCache in the convenient <code>UuidAndTitleCache</code> object.
-        * Retrieving this list is considered to be significantly faster than initializing the fully fledged buiseness
-        * objects. To be used in cases where you want to present large amount of data and provide details after
-        * a selection has been made.
-        *
-        * @return a list of <code>UuidAndTitleCache</code> instances
-        * @see #getUuidAndTitleCache(Class, Integer, String)
-        */
-       public List<UuidAndTitleCache<T>> getUuidAndTitleCache(Integer limit, String pattern);
-
-       /**
-        * Like {@link #getUuidAndTitleCache(Integer, String)} but searching only on a subclass
-        * of the type handled by the DAO.
-        *
-        * @param clazz the (sub)class
-        * @param limit max number of results
-        * @param pattern search pattern
 
-        * @see #getUuidAndTitleCache(Integer, String)
-        */
-       public <S extends T> List<UuidAndTitleCache<S>> getUuidAndTitleCache(Class<S> clazz, Integer limit, String pattern);
-
-
-       /**
-     * Return a list of all uuids mapped to titleCache in the convenient <code>UuidAndTitleCache</code> object.
-     * Retrieving this list is considered to be significantly faster than initializing the fully fledged buiseness
-     * objects. To be used in cases where you want to present large amount of data and provide details after
-     * a selection has been made.
-     *
-     * @return a list of <code>UuidAndTitleCache</code> instances
-     */
-    public List<UuidAndTitleCache<T>> getUuidAndTitleCache();
 
     /**
      * Returns the titleCache for a given object defined by uuid.
index 3c0ada55a029b0e0fdbab7913bd55808fd3e33fc..00d389cec554b41105e94a0ed7952a38a8fa5320 100644 (file)
@@ -159,7 +159,7 @@ public class AgentDaoImpl extends IdentifiableDaoBase<AgentBase> implements IAge
        }
 
        @Override
-       public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache() {
+       public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache(Integer limit, String pattern) {
                Query query = getSession().createQuery("select uuid, id, titleCache from " + type.getSimpleName() + " where dtype = 'Institution'");
                return getUuidAndTitleCache(query);
        }
index dbcc3ec5c5689b161847132dac009871db17ebe3..04382f76b26277f7d3ef9b57c2900e709092327b 100644 (file)
@@ -9,16 +9,21 @@
 
 package eu.etaxonomy.cdm.persistence.dao.hibernate.common;
 
+import java.util.ArrayList;
 import java.util.List;
+import java.util.UUID;
 
 import org.apache.log4j.Logger;
 import org.hibernate.Query;
+import org.hibernate.Session;
 
 import eu.etaxonomy.cdm.model.common.AnnotatableEntity;
 import eu.etaxonomy.cdm.model.common.Annotation;
+import eu.etaxonomy.cdm.model.common.IAnnotatableEntity;
 import eu.etaxonomy.cdm.model.common.Marker;
 import eu.etaxonomy.cdm.model.common.MarkerType;
 import eu.etaxonomy.cdm.persistence.dao.common.IAnnotatableDao;
+import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.query.OrderHint;
 import eu.etaxonomy.cdm.persistence.query.OrderHint.SortOrder;
 
@@ -227,4 +232,57 @@ public abstract class AnnotatableDaoImpl<T extends AnnotatableEntity>
                return result;
        }
 
+    @Override
+    public List<UuidAndTitleCache<T>> getUuidAndTitleCache(Integer limit, String pattern){
+        return getUuidAndTitleCache(type, limit, pattern);
+    }
+
+
+    @Override
+    public <S extends T> List<UuidAndTitleCache<S>> getUuidAndTitleCache(Class<S> clazz, Integer limit, String pattern){
+        Session session = getSession();
+        Query query = null;
+        if (pattern != null){
+            query = session.createQuery("select uuid, id, titleCache from " + clazz.getSimpleName() +" where titleCache like :pattern");
+            pattern = pattern.replace("*", "%");
+            pattern = pattern.replace("?", "_");
+            pattern = pattern + "%";
+            query.setParameter("pattern", pattern);
+        } else {
+            query = session.createQuery("select uuid, id, titleCache from " + clazz.getSimpleName() );
+        }
+        if (limit != null){
+           query.setMaxResults(limit);
+        }
+        return getUuidAndTitleCache(query);
+    }
+
+
+    @Override
+    public List<UuidAndTitleCache<T>> getUuidAndTitleCache(){
+        return getUuidAndTitleCache(type, null, null);
+    }
+
+    protected <E extends IAnnotatableEntity> List<UuidAndTitleCache<E>> getUuidAndAbbrevTitleCache(Query query){
+        List<UuidAndTitleCache<E>> list = new ArrayList<UuidAndTitleCache<E>>();
+
+        List<Object[]> result = query.list();
+
+        for(Object[] object : result){
+            list.add(new UuidAndTitleCache<E>((UUID) object[0],(Integer) object[1], (String) object[3], (String) object[2]));
+        }
+        return list;
+    }
+
+    protected <E extends IAnnotatableEntity> List<UuidAndTitleCache<E>> getUuidAndTitleCache(Query query){
+        List<UuidAndTitleCache<E>> list = new ArrayList<UuidAndTitleCache<E>>();
+
+        List<Object[]> result = query.list();
+
+        for(Object[] object : result){
+            list.add(new UuidAndTitleCache<E>((UUID) object[0],(Integer) object[1], (String) object[2]));
+        }
+        return list;
+    }
+
 }
index edf384862572649d7743b73baba76934a2919241..6e7565faf41cb1dc911dd7057b898cf306df541c 100644 (file)
@@ -33,7 +33,6 @@ import org.hibernate.search.SearchFactory;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.common.Credit;
 import eu.etaxonomy.cdm.model.common.DefinedTerm;
-import eu.etaxonomy.cdm.model.common.IIdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
 import eu.etaxonomy.cdm.model.common.IdentifiableSource;
 import eu.etaxonomy.cdm.model.common.LSID;
@@ -41,7 +40,6 @@ import eu.etaxonomy.cdm.model.common.MarkerType;
 import eu.etaxonomy.cdm.model.media.Rights;
 import eu.etaxonomy.cdm.persistence.dao.QueryParseException;
 import eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao;
-import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.query.MatchMode;
 import eu.etaxonomy.cdm.persistence.query.OrderHint;
 
@@ -285,58 +283,7 @@ public class IdentifiableDaoBase<T extends IdentifiableEntity>
         }
     }
 
-    @Override
-    public List<UuidAndTitleCache<T>> getUuidAndTitleCache(Integer limit, String pattern){
-        return getUuidAndTitleCache(type, limit, pattern);
-    }
-
-
-    @Override
-    public <S extends T> List<UuidAndTitleCache<S>> getUuidAndTitleCache(Class<S> clazz, Integer limit, String pattern){
-        Session session = getSession();
-        Query query = null;
-        if (pattern != null){
-            query = session.createQuery("select uuid, id, titleCache from " + clazz.getSimpleName() +" where titleCache like :pattern");
-            pattern = pattern.replace("*", "%");
-            pattern = pattern.replace("?", "_");
-            pattern = pattern + "%";
-            query.setParameter("pattern", pattern);
-        } else {
-            query = session.createQuery("select uuid, id, titleCache from " + clazz.getSimpleName() );
-        }
-        if (limit != null){
-           query.setMaxResults(limit);
-        }
-        return getUuidAndTitleCache(query);
-    }
-
 
-    @Override
-    public List<UuidAndTitleCache<T>> getUuidAndTitleCache(){
-        return getUuidAndTitleCache(type, null, null);
-    }
-
-    protected <E extends IIdentifiableEntity> List<UuidAndTitleCache<E>> getUuidAndAbbrevTitleCache(Query query){
-        List<UuidAndTitleCache<E>> list = new ArrayList<UuidAndTitleCache<E>>();
-
-        List<Object[]> result = query.list();
-
-        for(Object[] object : result){
-            list.add(new UuidAndTitleCache<E>((UUID) object[0],(Integer) object[1], (String) object[3], (String) object[2]));
-        }
-        return list;
-    }
-
-    protected <E extends IIdentifiableEntity> List<UuidAndTitleCache<E>> getUuidAndTitleCache(Query query){
-        List<UuidAndTitleCache<E>> list = new ArrayList<UuidAndTitleCache<E>>();
-
-        List<Object[]> result = query.list();
-
-        for(Object[] object : result){
-            list.add(new UuidAndTitleCache<E>((UUID) object[0],(Integer) object[1], (String) object[2]));
-        }
-        return list;
-    }
 
     @SuppressWarnings("deprecation")
     @Override
index e09fadd4bd9747c3facfd5da3fa49d3639212dde..9b2d0349bb476a36622032166cfe7669a89191b8 100644 (file)
@@ -44,12 +44,19 @@ public class AmplificationDaoHibernateImpl extends AnnotatableDaoImpl<Amplificat
     }
 
     @Override
-    public List<UuidAndTitleCache<Amplification>> getAmplificationUuidAndLabelCache() {
+    public List<UuidAndTitleCache<Amplification>> getAmplificationUuidAndLabelCache(Integer limit, String pattern) {
         List<UuidAndTitleCache<Amplification>> list = new ArrayList<UuidAndTitleCache<Amplification>>();
         Session session = getSession();
-
-        Query query = session.createQuery("select uuid, id, labelCache from Amplification");
-
+        Query query;
+        if (pattern != null){
+            query = session.createQuery("select uuid, id, labelCache from Amplification where labelCache like :pattern");
+            query.setParameter("pattern", pattern);
+        }else{
+            query = session.createQuery("select uuid, id, labelCache from Amplification");
+        }
+        if (limit != null){
+            query.setMaxResults(limit);
+         }
         @SuppressWarnings("unchecked")
         List<Object[]> result = query.list();
 
index 6fe091d269a16f7950827a33eaadf3dc99673a11..9e0f1d2a0634a6940ad273075743ba2ac95d9efb 100644 (file)
@@ -32,7 +32,7 @@ public interface IAmplificationDao extends IAnnotatableDao<Amplification>{
      * {@link Amplification}s found in the data base.
      * @return a list of {@link UuidAndTitleCache}
      */
-    public List<UuidAndTitleCache<Amplification>> getAmplificationUuidAndLabelCache();
+    public List<UuidAndTitleCache<Amplification>> getAmplificationUuidAndLabelCache(Integer limit, String pattern);
 
     /**
      * Return a count of {@link Amplification}s matching the given query string in the titleCache, optionally with a particular MatchMode
index 348c20a203019785626e3f79cc24143ec9ac592e..dee70f8ceed0d64f07ac6450e15cbd73839037ae 100644 (file)
@@ -134,8 +134,8 @@ public class AgentServiceImpl extends IdentifiableServiceBase<AgentBase,IAgentDa
        }
 
        @Override
-       public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache() {
-               return dao.getInstitutionUuidAndTitleCache();
+       public List<UuidAndTitleCache<AgentBase>> getInstitutionUuidAndTitleCache(Integer limit, String pattern) {
+               return dao.getUuidAndAbbrevTitleCache(limit, pattern, Institution.class);
        }
 
        @Override
index e209c5339534ed9bf22880d43aaa5bf26961988d..13c43757f2b2749798e10266acde7907a822b90b 100644 (file)
@@ -21,6 +21,7 @@ import eu.etaxonomy.cdm.model.common.Annotation;
 import eu.etaxonomy.cdm.model.common.Marker;\r
 import eu.etaxonomy.cdm.model.common.MarkerType;\r
 import eu.etaxonomy.cdm.persistence.dao.common.IAnnotatableDao;\r
+import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;\r
 import eu.etaxonomy.cdm.persistence.query.OrderHint;\r
 \r
 public abstract class AnnotatableServiceBase<T extends AnnotatableEntity,DAO extends IAnnotatableDao<T>> extends VersionableServiceBase<T, DAO>\r
@@ -64,5 +65,17 @@ public abstract class AnnotatableServiceBase<T extends AnnotatableEntity,DAO ext
                return dao.countMarkers(clazz, technical);\r
        }\r
 \r
+       @Transactional(readOnly = true)\r
+    @Override\r
+    public List<UuidAndTitleCache<T>> getUuidAndTitleCache(Integer limit, String pattern) {\r
+        return dao.getUuidAndTitleCache(limit, pattern);\r
+    }\r
+\r
+    @Transactional(readOnly = true)\r
+    @Override\r
+    public <S extends T> List<UuidAndTitleCache<S>> getUuidAndTitleCache(Class<S> clazz,Integer limit, String pattern) {\r
+        return dao.getUuidAndTitleCache(clazz, limit, pattern);\r
+    }\r
+\r
 \r
 }\r
index 8193e984070847a787630b5f804271e0968381de..ce01546ce5f10ab374f780c5d1c98f41db99ec4e 100644 (file)
@@ -104,7 +104,7 @@ public interface IAgentService extends IIdentifiableEntityService<AgentBase> {
         *
         * @return a list of <code>UuidAndTitleCache</code> instances
         */
-       public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache();
+       public List<UuidAndTitleCache<AgentBase>> getInstitutionUuidAndTitleCache(Integer limit, String pattern);
 
 
        /**
index 3622be147b79e6588f2b8826990982f04745657c..c2738d2d518dbf337723d1bff97a23fd7dc9663f 100644 (file)
@@ -16,6 +16,7 @@ import eu.etaxonomy.cdm.model.common.Annotation;
 import eu.etaxonomy.cdm.model.common.Marker;\r
 import eu.etaxonomy.cdm.model.common.MarkerType;\r
 import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;\r
+import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;\r
 import eu.etaxonomy.cdm.persistence.query.OrderHint;\r
 \r
 public interface IAnnotatableService<T extends AnnotatableEntity>\r
@@ -72,4 +73,28 @@ public interface IAnnotatableService<T extends AnnotatableEntity>
         * @return a count of markers\r
         */\r
        public int countMarkers(Class<? extends T> clazz, Boolean technical);\r
+        /**\r
+     * Like {@link #getUuidAndTitleCache(Integer, String)} but searching only on a subclass\r
+     * of the type handled by the DAO.\r
+     *\r
+     * @param clazz the (sub)class\r
+     * @param limit max number of results\r
+     * @param pattern search pattern\r
+\r
+     * @see #getUuidAndTitleCache(Integer, String)\r
+     */\r
+    public <S extends T> List<UuidAndTitleCache<S>> getUuidAndTitleCache(Class<S> clazz, Integer limit, String pattern);\r
+\r
+    /**\r
+     * Return a list of all uuids mapped to titleCache in the convenient <code>UuidAndTitleCache</code> object.\r
+     * Retrieving this list is considered to be significantly faster than initializing the fully fledged business\r
+     * objects. To be used in cases where you want to present large amount of data and provide details after\r
+     * a selection has been made.\r
+     *\r
+     * @return a list of <code>UuidAndTitleCache</code> instances\r
+     *\r
+     * @see #getUuidAndTitleCache(Class, Integer, String)\r
+     */\r
+    public List<UuidAndTitleCache<T>> getUuidAndTitleCache(Integer limit, String pattern);\r
+\r
 }\r
index 86bf3b2e3a4e0d3e58d50776bcb003bbfb294002..ab21c0d1b0ab3633fde5e0948e910cd8ef5efa0a 100644 (file)
@@ -27,7 +27,6 @@ import eu.etaxonomy.cdm.model.common.LSID;
 import eu.etaxonomy.cdm.model.common.MarkerType;
 import eu.etaxonomy.cdm.model.media.Rights;
 import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
-import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache;
 import eu.etaxonomy.cdm.persistence.query.MatchMode;
 import eu.etaxonomy.cdm.persistence.query.OrderHint;
 import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy;
@@ -100,17 +99,6 @@ public interface IIdentifiableEntityService<T extends IdentifiableEntity>
      */
     public Pager<Rights> getRights(T t, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
 
-    /**
-     * Return a list of all uuids mapped to titleCache in the convenient <code>UuidAndTitleCache</code> object.
-     * Retrieving this list is considered to be significantly faster than initializing the fully fledged business
-     * objects. To be used in cases where you want to present large amount of data and provide details after
-     * a selection has been made.
-     *
-     * @return a list of <code>UuidAndTitleCache</code> instances
-     *
-     * @see #getUuidAndTitleCache(Class, Integer, String)
-     */
-    public List<UuidAndTitleCache<T>> getUuidAndTitleCache(Integer limit, String pattern);
 
     /**
      * Returns the titleCache for a given object defined by uuid.
@@ -121,17 +109,7 @@ public interface IIdentifiableEntityService<T extends IdentifiableEntity>
      */
     public String getTitleCache(UUID uuid, boolean refresh);
 
-    /**
-     * Like {@link #getUuidAndTitleCache(Integer, String)} but searching only on a subclass
-     * of the type handled by the DAO.
-     *
-     * @param clazz the (sub)class
-     * @param limit max number of results
-     * @param pattern search pattern
 
-     * @see #getUuidAndTitleCache(Integer, String)
-     */
-    public <S extends T> List<UuidAndTitleCache<S>> getUuidAndTitleCache(Class<S> clazz, Integer limit, String pattern);
 
     /**
      * Return a Pager of objects matching the given query string, optionally filtered by class, optionally with a particular MatchMode
index 2e27734f64dc8ef52cbd262815c5f5693fcf6f8d..7e5f77816256d3e15f3c25bfef920485c3defbd2 100644 (file)
@@ -45,8 +45,8 @@ public class AmplificationServiceImpl extends AnnotatableServiceBase<Amplificati
     }
 
     @Override
-    public List<UuidAndTitleCache<Amplification>> getAmplificationUuidAndLabelCache() {
-        return dao.getAmplificationUuidAndLabelCache();
+    public List<UuidAndTitleCache<Amplification>> getAmplificationUuidAndLabelCache(Integer limit, String pattern) {
+        return dao.getAmplificationUuidAndLabelCache(limit, pattern);
     }
 
     @Override
index 05491ba819e03223324d530d0a2442a964c7fbd5..4c58659385603ef2e3803c0e0d6397f9a7e71fac 100644 (file)
@@ -33,7 +33,7 @@ public interface IAmplificationService extends IAnnotatableService<Amplification
      * {@link Amplification}s found in the data base.
      * @return a list of {@link UuidAndTitleCache}
      */
-    public List<UuidAndTitleCache<Amplification>> getAmplificationUuidAndLabelCache();
+    public List<UuidAndTitleCache<Amplification>> getAmplificationUuidAndLabelCache(Integer limit, String pattern);
 
     /**
     * Return a List of {@link Amplification}s matching the given query string, optionally with a particular MatchMode