Revision 42d4306a
Added by Katja Luther over 6 years ago
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/agent/IAgentDao.java | ||
---|---|---|
104 | 104 |
/** |
105 | 105 |
* @return |
106 | 106 |
*/ |
107 |
public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache(); |
|
107 |
public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache(Integer limit, String pattern);
|
|
108 | 108 |
|
109 | 109 |
/** |
110 | 110 |
* @param limit |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/common/IAnnotatableDao.java | ||
---|---|---|
1 | 1 |
/** |
2 | 2 |
* Copyright (C) 2007 EDIT |
3 |
* European Distributed Institute of Taxonomy
|
|
3 |
* European Distributed Institute of Taxonomy |
|
4 | 4 |
* http://www.e-taxonomy.eu |
5 |
*
|
|
5 |
* |
|
6 | 6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
7 | 7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
8 | 8 |
*/ |
... | ... | |
13 | 13 |
|
14 | 14 |
import eu.etaxonomy.cdm.model.common.AnnotatableEntity; |
15 | 15 |
import eu.etaxonomy.cdm.model.common.Annotation; |
16 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
17 | 16 |
import eu.etaxonomy.cdm.model.common.Marker; |
17 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
|
18 | 18 |
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer; |
19 |
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache; |
|
19 | 20 |
import eu.etaxonomy.cdm.persistence.query.OrderHint; |
20 | 21 |
|
21 | 22 |
/** |
... | ... | |
24 | 25 |
* @version 1.0 |
25 | 26 |
*/ |
26 | 27 |
public interface IAnnotatableDao<T extends AnnotatableEntity> extends IVersionableDao<T>{ |
27 |
|
|
28 |
|
|
28 | 29 |
/** |
29 | 30 |
* Returns a List of Annotations belonging to the supplied AnnotatableEntity |
30 |
*
|
|
31 |
* |
|
31 | 32 |
* @param annotatableEntity the entity which is annotated |
32 | 33 |
* @param status The status of the annotations (null to return annotations regardless of status) |
33 | 34 |
* @param pageSize The maximum number of annotations returned (can be null for all annotations) |
... | ... | |
37 | 38 |
* @return a List of Annotation instances |
38 | 39 |
*/ |
39 | 40 |
public List<Annotation> getAnnotations(T annotatableEntity, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths); |
40 |
|
|
41 |
|
|
41 | 42 |
/** |
42 | 43 |
* Returns a count of Annotations belonging to the supplied AnnotatableEntity |
43 |
*
|
|
44 |
* |
|
44 | 45 |
* @param annotatableEntity the entity which is annotated |
45 | 46 |
* @param status The status of the annotations (null to count all annotations regardless of status) |
46 | 47 |
* @return a count of Annotation instances |
47 | 48 |
*/ |
48 | 49 |
public int countAnnotations(T annotatableEntity, MarkerType status); |
49 |
|
|
50 |
|
|
50 | 51 |
/** |
51 |
* Returns a count of Markers belonging to the supplied AnnotatableEntity
|
|
52 |
*
|
|
52 |
* Returns a count of Markers belonging to the supplied AnnotatableEntity |
|
53 |
* |
|
53 | 54 |
* @param annotatableEntity the entity which is marked |
54 | 55 |
* @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not) |
55 | 56 |
* @return a count of Marker instances |
56 | 57 |
*/ |
57 | 58 |
public int countMarkers(T annotatableEntity, Boolean technical); |
58 |
|
|
59 |
|
|
59 | 60 |
/** |
60 |
*
|
|
61 |
* |
|
61 | 62 |
* @param annotatableEntity the entity which is marked |
62 | 63 |
* @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not) |
63 | 64 |
* @param pageSize The maximum number of markers returned (can be null for all markers) |
... | ... | |
68 | 69 |
*/ |
69 | 70 |
public List<Marker> getMarkers(T annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths); |
70 | 71 |
/** |
71 |
* Returns a list of arrays representing counts of entities of type clazz, grouped by their markerTypes. The arrays have two elements.
|
|
72 |
* Returns a list of arrays representing counts of entities of type clazz, grouped by their markerTypes. The arrays have two elements. |
|
72 | 73 |
* The first element is the MarkerType, initialized using the propertyPaths parameter. The second element is the count of all markers of Objects |
73 | 74 |
* 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 |
74 | 75 |
* titleCache of the markerType, in ascending order. |
75 |
*
|
|
76 |
* |
|
76 | 77 |
* @param clazz optionally restrict the markers to those belonging to this class |
77 | 78 |
* @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not) |
78 | 79 |
* @param pageSize The maximum number of arrays returned (can be null for all arrays) |
... | ... | |
81 | 82 |
* @return |
82 | 83 |
*/ |
83 | 84 |
public List<Object[]> groupMarkers(Class<? extends T> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths); |
84 |
|
|
85 |
|
|
85 | 86 |
/** |
86 | 87 |
* returns a count of all markers belonging to that clazz, optionally filtered to include only technical or only non-technical markers. |
87 |
*
|
|
88 |
* |
|
88 | 89 |
* @param clazz optionally restrict the markers to those belonging to this class |
89 | 90 |
* @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not) |
90 | 91 |
* @return a count of markers |
91 | 92 |
*/ |
92 | 93 |
public int countMarkers(Class<? extends T> clazz, Boolean technical); |
94 |
|
|
95 |
/** |
|
96 |
* Return a list of all uuids mapped to titleCache in the convenient <code>UuidAndTitleCache</code> object. |
|
97 |
* Retrieving this list is considered to be significantly faster than initializing the fully fledged buiseness |
|
98 |
* objects. To be used in cases where you want to present large amount of data and provide details after |
|
99 |
* a selection has been made. |
|
100 |
* |
|
101 |
* @return a list of <code>UuidAndTitleCache</code> instances |
|
102 |
* @see #getUuidAndTitleCache(Class, Integer, String) |
|
103 |
*/ |
|
104 |
public List<UuidAndTitleCache<T>> getUuidAndTitleCache(Integer limit, String pattern); |
|
105 |
|
|
106 |
/** |
|
107 |
* Like {@link #getUuidAndTitleCache(Integer, String)} but searching only on a subclass |
|
108 |
* of the type handled by the DAO. |
|
109 |
* |
|
110 |
* @param clazz the (sub)class |
|
111 |
* @param limit max number of results |
|
112 |
* @param pattern search pattern |
|
113 |
|
|
114 |
* @see #getUuidAndTitleCache(Integer, String) |
|
115 |
*/ |
|
116 |
public <S extends T> List<UuidAndTitleCache<S>> getUuidAndTitleCache(Class<S> clazz, Integer limit, String pattern); |
|
117 |
|
|
118 |
|
|
119 |
/** |
|
120 |
* Return a list of all uuids mapped to titleCache in the convenient <code>UuidAndTitleCache</code> object. |
|
121 |
* Retrieving this list is considered to be significantly faster than initializing the fully fledged buiseness |
|
122 |
* objects. To be used in cases where you want to present large amount of data and provide details after |
|
123 |
* a selection has been made. |
|
124 |
* |
|
125 |
* @return a list of <code>UuidAndTitleCache</code> instances |
|
126 |
*/ |
|
127 |
public List<UuidAndTitleCache<T>> getUuidAndTitleCache(); |
|
93 | 128 |
} |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/common/IIdentifiableDao.java | ||
---|---|---|
22 | 22 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
23 | 23 |
import eu.etaxonomy.cdm.model.media.Rights; |
24 | 24 |
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer; |
25 |
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache; |
|
26 | 25 |
import eu.etaxonomy.cdm.persistence.query.MatchMode; |
27 | 26 |
import eu.etaxonomy.cdm.persistence.query.OrderHint; |
28 | 27 |
|
... | ... | |
85 | 84 |
// TODO Migrated from IOriginalSourceDao |
86 | 85 |
public List<T> findOriginalSourceByIdInSource(String idInSource, String idNamespace); |
87 | 86 |
|
88 |
/** |
|
89 |
* Return a list of all uuids mapped to titleCache in the convenient <code>UuidAndTitleCache</code> object. |
|
90 |
* Retrieving this list is considered to be significantly faster than initializing the fully fledged buiseness |
|
91 |
* objects. To be used in cases where you want to present large amount of data and provide details after |
|
92 |
* a selection has been made. |
|
93 |
* |
|
94 |
* @return a list of <code>UuidAndTitleCache</code> instances |
|
95 |
* @see #getUuidAndTitleCache(Class, Integer, String) |
|
96 |
*/ |
|
97 |
public List<UuidAndTitleCache<T>> getUuidAndTitleCache(Integer limit, String pattern); |
|
98 |
|
|
99 |
/** |
|
100 |
* Like {@link #getUuidAndTitleCache(Integer, String)} but searching only on a subclass |
|
101 |
* of the type handled by the DAO. |
|
102 |
* |
|
103 |
* @param clazz the (sub)class |
|
104 |
* @param limit max number of results |
|
105 |
* @param pattern search pattern |
|
106 | 87 |
|
107 |
* @see #getUuidAndTitleCache(Integer, String) |
|
108 |
*/ |
|
109 |
public <S extends T> List<UuidAndTitleCache<S>> getUuidAndTitleCache(Class<S> clazz, Integer limit, String pattern); |
|
110 |
|
|
111 |
|
|
112 |
/** |
|
113 |
* Return a list of all uuids mapped to titleCache in the convenient <code>UuidAndTitleCache</code> object. |
|
114 |
* Retrieving this list is considered to be significantly faster than initializing the fully fledged buiseness |
|
115 |
* objects. To be used in cases where you want to present large amount of data and provide details after |
|
116 |
* a selection has been made. |
|
117 |
* |
|
118 |
* @return a list of <code>UuidAndTitleCache</code> instances |
|
119 |
*/ |
|
120 |
public List<UuidAndTitleCache<T>> getUuidAndTitleCache(); |
|
121 | 88 |
|
122 | 89 |
/** |
123 | 90 |
* Returns the titleCache for a given object defined by uuid. |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/agent/AgentDaoImpl.java | ||
---|---|---|
159 | 159 |
} |
160 | 160 |
|
161 | 161 |
@Override |
162 |
public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache() { |
|
162 |
public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache(Integer limit, String pattern) {
|
|
163 | 163 |
Query query = getSession().createQuery("select uuid, id, titleCache from " + type.getSimpleName() + " where dtype = 'Institution'"); |
164 | 164 |
return getUuidAndTitleCache(query); |
165 | 165 |
} |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/AnnotatableDaoImpl.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.cdm.persistence.dao.hibernate.common; |
11 | 11 |
|
12 |
import java.util.ArrayList; |
|
12 | 13 |
import java.util.List; |
14 |
import java.util.UUID; |
|
13 | 15 |
|
14 | 16 |
import org.apache.log4j.Logger; |
15 | 17 |
import org.hibernate.Query; |
18 |
import org.hibernate.Session; |
|
16 | 19 |
|
17 | 20 |
import eu.etaxonomy.cdm.model.common.AnnotatableEntity; |
18 | 21 |
import eu.etaxonomy.cdm.model.common.Annotation; |
22 |
import eu.etaxonomy.cdm.model.common.IAnnotatableEntity; |
|
19 | 23 |
import eu.etaxonomy.cdm.model.common.Marker; |
20 | 24 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
21 | 25 |
import eu.etaxonomy.cdm.persistence.dao.common.IAnnotatableDao; |
26 |
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache; |
|
22 | 27 |
import eu.etaxonomy.cdm.persistence.query.OrderHint; |
23 | 28 |
import eu.etaxonomy.cdm.persistence.query.OrderHint.SortOrder; |
24 | 29 |
|
... | ... | |
227 | 232 |
return result; |
228 | 233 |
} |
229 | 234 |
|
235 |
@Override |
|
236 |
public List<UuidAndTitleCache<T>> getUuidAndTitleCache(Integer limit, String pattern){ |
|
237 |
return getUuidAndTitleCache(type, limit, pattern); |
|
238 |
} |
|
239 |
|
|
240 |
|
|
241 |
@Override |
|
242 |
public <S extends T> List<UuidAndTitleCache<S>> getUuidAndTitleCache(Class<S> clazz, Integer limit, String pattern){ |
|
243 |
Session session = getSession(); |
|
244 |
Query query = null; |
|
245 |
if (pattern != null){ |
|
246 |
query = session.createQuery("select uuid, id, titleCache from " + clazz.getSimpleName() +" where titleCache like :pattern"); |
|
247 |
pattern = pattern.replace("*", "%"); |
|
248 |
pattern = pattern.replace("?", "_"); |
|
249 |
pattern = pattern + "%"; |
|
250 |
query.setParameter("pattern", pattern); |
|
251 |
} else { |
|
252 |
query = session.createQuery("select uuid, id, titleCache from " + clazz.getSimpleName() ); |
|
253 |
} |
|
254 |
if (limit != null){ |
|
255 |
query.setMaxResults(limit); |
|
256 |
} |
|
257 |
return getUuidAndTitleCache(query); |
|
258 |
} |
|
259 |
|
|
260 |
|
|
261 |
@Override |
|
262 |
public List<UuidAndTitleCache<T>> getUuidAndTitleCache(){ |
|
263 |
return getUuidAndTitleCache(type, null, null); |
|
264 |
} |
|
265 |
|
|
266 |
protected <E extends IAnnotatableEntity> List<UuidAndTitleCache<E>> getUuidAndAbbrevTitleCache(Query query){ |
|
267 |
List<UuidAndTitleCache<E>> list = new ArrayList<UuidAndTitleCache<E>>(); |
|
268 |
|
|
269 |
List<Object[]> result = query.list(); |
|
270 |
|
|
271 |
for(Object[] object : result){ |
|
272 |
list.add(new UuidAndTitleCache<E>((UUID) object[0],(Integer) object[1], (String) object[3], (String) object[2])); |
|
273 |
} |
|
274 |
return list; |
|
275 |
} |
|
276 |
|
|
277 |
protected <E extends IAnnotatableEntity> List<UuidAndTitleCache<E>> getUuidAndTitleCache(Query query){ |
|
278 |
List<UuidAndTitleCache<E>> list = new ArrayList<UuidAndTitleCache<E>>(); |
|
279 |
|
|
280 |
List<Object[]> result = query.list(); |
|
281 |
|
|
282 |
for(Object[] object : result){ |
|
283 |
list.add(new UuidAndTitleCache<E>((UUID) object[0],(Integer) object[1], (String) object[2])); |
|
284 |
} |
|
285 |
return list; |
|
286 |
} |
|
287 |
|
|
230 | 288 |
} |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/common/IdentifiableDaoBase.java | ||
---|---|---|
33 | 33 |
import eu.etaxonomy.cdm.model.common.CdmBase; |
34 | 34 |
import eu.etaxonomy.cdm.model.common.Credit; |
35 | 35 |
import eu.etaxonomy.cdm.model.common.DefinedTerm; |
36 |
import eu.etaxonomy.cdm.model.common.IIdentifiableEntity; |
|
37 | 36 |
import eu.etaxonomy.cdm.model.common.IdentifiableEntity; |
38 | 37 |
import eu.etaxonomy.cdm.model.common.IdentifiableSource; |
39 | 38 |
import eu.etaxonomy.cdm.model.common.LSID; |
... | ... | |
41 | 40 |
import eu.etaxonomy.cdm.model.media.Rights; |
42 | 41 |
import eu.etaxonomy.cdm.persistence.dao.QueryParseException; |
43 | 42 |
import eu.etaxonomy.cdm.persistence.dao.common.IIdentifiableDao; |
44 |
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache; |
|
45 | 43 |
import eu.etaxonomy.cdm.persistence.query.MatchMode; |
46 | 44 |
import eu.etaxonomy.cdm.persistence.query.OrderHint; |
47 | 45 |
|
... | ... | |
285 | 283 |
} |
286 | 284 |
} |
287 | 285 |
|
288 |
@Override |
|
289 |
public List<UuidAndTitleCache<T>> getUuidAndTitleCache(Integer limit, String pattern){ |
|
290 |
return getUuidAndTitleCache(type, limit, pattern); |
|
291 |
} |
|
292 |
|
|
293 |
|
|
294 |
@Override |
|
295 |
public <S extends T> List<UuidAndTitleCache<S>> getUuidAndTitleCache(Class<S> clazz, Integer limit, String pattern){ |
|
296 |
Session session = getSession(); |
|
297 |
Query query = null; |
|
298 |
if (pattern != null){ |
|
299 |
query = session.createQuery("select uuid, id, titleCache from " + clazz.getSimpleName() +" where titleCache like :pattern"); |
|
300 |
pattern = pattern.replace("*", "%"); |
|
301 |
pattern = pattern.replace("?", "_"); |
|
302 |
pattern = pattern + "%"; |
|
303 |
query.setParameter("pattern", pattern); |
|
304 |
} else { |
|
305 |
query = session.createQuery("select uuid, id, titleCache from " + clazz.getSimpleName() ); |
|
306 |
} |
|
307 |
if (limit != null){ |
|
308 |
query.setMaxResults(limit); |
|
309 |
} |
|
310 |
return getUuidAndTitleCache(query); |
|
311 |
} |
|
312 |
|
|
313 | 286 |
|
314 |
@Override |
|
315 |
public List<UuidAndTitleCache<T>> getUuidAndTitleCache(){ |
|
316 |
return getUuidAndTitleCache(type, null, null); |
|
317 |
} |
|
318 |
|
|
319 |
protected <E extends IIdentifiableEntity> List<UuidAndTitleCache<E>> getUuidAndAbbrevTitleCache(Query query){ |
|
320 |
List<UuidAndTitleCache<E>> list = new ArrayList<UuidAndTitleCache<E>>(); |
|
321 |
|
|
322 |
List<Object[]> result = query.list(); |
|
323 |
|
|
324 |
for(Object[] object : result){ |
|
325 |
list.add(new UuidAndTitleCache<E>((UUID) object[0],(Integer) object[1], (String) object[3], (String) object[2])); |
|
326 |
} |
|
327 |
return list; |
|
328 |
} |
|
329 |
|
|
330 |
protected <E extends IIdentifiableEntity> List<UuidAndTitleCache<E>> getUuidAndTitleCache(Query query){ |
|
331 |
List<UuidAndTitleCache<E>> list = new ArrayList<UuidAndTitleCache<E>>(); |
|
332 |
|
|
333 |
List<Object[]> result = query.list(); |
|
334 |
|
|
335 |
for(Object[] object : result){ |
|
336 |
list.add(new UuidAndTitleCache<E>((UUID) object[0],(Integer) object[1], (String) object[2])); |
|
337 |
} |
|
338 |
return list; |
|
339 |
} |
|
340 | 287 |
|
341 | 288 |
@SuppressWarnings("deprecation") |
342 | 289 |
@Override |
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/hibernate/molecular/AmplificationDaoHibernateImpl.java | ||
---|---|---|
44 | 44 |
} |
45 | 45 |
|
46 | 46 |
@Override |
47 |
public List<UuidAndTitleCache<Amplification>> getAmplificationUuidAndLabelCache() { |
|
47 |
public List<UuidAndTitleCache<Amplification>> getAmplificationUuidAndLabelCache(Integer limit, String pattern) {
|
|
48 | 48 |
List<UuidAndTitleCache<Amplification>> list = new ArrayList<UuidAndTitleCache<Amplification>>(); |
49 | 49 |
Session session = getSession(); |
50 |
|
|
51 |
Query query = session.createQuery("select uuid, id, labelCache from Amplification"); |
|
52 |
|
|
50 |
Query query; |
|
51 |
if (pattern != null){ |
|
52 |
query = session.createQuery("select uuid, id, labelCache from Amplification where labelCache like :pattern"); |
|
53 |
query.setParameter("pattern", pattern); |
|
54 |
}else{ |
|
55 |
query = session.createQuery("select uuid, id, labelCache from Amplification"); |
|
56 |
} |
|
57 |
if (limit != null){ |
|
58 |
query.setMaxResults(limit); |
|
59 |
} |
|
53 | 60 |
@SuppressWarnings("unchecked") |
54 | 61 |
List<Object[]> result = query.list(); |
55 | 62 |
|
cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/molecular/IAmplificationDao.java | ||
---|---|---|
32 | 32 |
* {@link Amplification}s found in the data base. |
33 | 33 |
* @return a list of {@link UuidAndTitleCache} |
34 | 34 |
*/ |
35 |
public List<UuidAndTitleCache<Amplification>> getAmplificationUuidAndLabelCache(); |
|
35 |
public List<UuidAndTitleCache<Amplification>> getAmplificationUuidAndLabelCache(Integer limit, String pattern);
|
|
36 | 36 |
|
37 | 37 |
/** |
38 | 38 |
* Return a count of {@link Amplification}s matching the given query string in the titleCache, optionally with a particular MatchMode |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/AgentServiceImpl.java | ||
---|---|---|
134 | 134 |
} |
135 | 135 |
|
136 | 136 |
@Override |
137 |
public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache() {
|
|
138 |
return dao.getInstitutionUuidAndTitleCache();
|
|
137 |
public List<UuidAndTitleCache<AgentBase>> getInstitutionUuidAndTitleCache(Integer limit, String pattern) {
|
|
138 |
return dao.getUuidAndAbbrevTitleCache(limit, pattern, Institution.class);
|
|
139 | 139 |
} |
140 | 140 |
|
141 | 141 |
@Override |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/AnnotatableServiceBase.java | ||
---|---|---|
21 | 21 |
import eu.etaxonomy.cdm.model.common.Marker; |
22 | 22 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
23 | 23 |
import eu.etaxonomy.cdm.persistence.dao.common.IAnnotatableDao; |
24 |
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache; |
|
24 | 25 |
import eu.etaxonomy.cdm.persistence.query.OrderHint; |
25 | 26 |
|
26 | 27 |
public abstract class AnnotatableServiceBase<T extends AnnotatableEntity,DAO extends IAnnotatableDao<T>> extends VersionableServiceBase<T, DAO> |
... | ... | |
64 | 65 |
return dao.countMarkers(clazz, technical); |
65 | 66 |
} |
66 | 67 |
|
68 |
@Transactional(readOnly = true) |
|
69 |
@Override |
|
70 |
public List<UuidAndTitleCache<T>> getUuidAndTitleCache(Integer limit, String pattern) { |
|
71 |
return dao.getUuidAndTitleCache(limit, pattern); |
|
72 |
} |
|
73 |
|
|
74 |
@Transactional(readOnly = true) |
|
75 |
@Override |
|
76 |
public <S extends T> List<UuidAndTitleCache<S>> getUuidAndTitleCache(Class<S> clazz,Integer limit, String pattern) { |
|
77 |
return dao.getUuidAndTitleCache(clazz, limit, pattern); |
|
78 |
} |
|
79 |
|
|
67 | 80 |
|
68 | 81 |
} |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IAgentService.java | ||
---|---|---|
104 | 104 |
* |
105 | 105 |
* @return a list of <code>UuidAndTitleCache</code> instances |
106 | 106 |
*/ |
107 |
public List<UuidAndTitleCache<Institution>> getInstitutionUuidAndTitleCache();
|
|
107 |
public List<UuidAndTitleCache<AgentBase>> getInstitutionUuidAndTitleCache(Integer limit, String pattern);
|
|
108 | 108 |
|
109 | 109 |
|
110 | 110 |
/** |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IAnnotatableService.java | ||
---|---|---|
16 | 16 |
import eu.etaxonomy.cdm.model.common.Marker; |
17 | 17 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
18 | 18 |
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer; |
19 |
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache; |
|
19 | 20 |
import eu.etaxonomy.cdm.persistence.query.OrderHint; |
20 | 21 |
|
21 | 22 |
public interface IAnnotatableService<T extends AnnotatableEntity> |
... | ... | |
72 | 73 |
* @return a count of markers |
73 | 74 |
*/ |
74 | 75 |
public int countMarkers(Class<? extends T> clazz, Boolean technical); |
76 |
/** |
|
77 |
* Like {@link #getUuidAndTitleCache(Integer, String)} but searching only on a subclass |
|
78 |
* of the type handled by the DAO. |
|
79 |
* |
|
80 |
* @param clazz the (sub)class |
|
81 |
* @param limit max number of results |
|
82 |
* @param pattern search pattern |
|
83 |
|
|
84 |
* @see #getUuidAndTitleCache(Integer, String) |
|
85 |
*/ |
|
86 |
public <S extends T> List<UuidAndTitleCache<S>> getUuidAndTitleCache(Class<S> clazz, Integer limit, String pattern); |
|
87 |
|
|
88 |
/** |
|
89 |
* Return a list of all uuids mapped to titleCache in the convenient <code>UuidAndTitleCache</code> object. |
|
90 |
* Retrieving this list is considered to be significantly faster than initializing the fully fledged business |
|
91 |
* objects. To be used in cases where you want to present large amount of data and provide details after |
|
92 |
* a selection has been made. |
|
93 |
* |
|
94 |
* @return a list of <code>UuidAndTitleCache</code> instances |
|
95 |
* |
|
96 |
* @see #getUuidAndTitleCache(Class, Integer, String) |
|
97 |
*/ |
|
98 |
public List<UuidAndTitleCache<T>> getUuidAndTitleCache(Integer limit, String pattern); |
|
99 |
|
|
75 | 100 |
} |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/IIdentifiableEntityService.java | ||
---|---|---|
27 | 27 |
import eu.etaxonomy.cdm.model.common.MarkerType; |
28 | 28 |
import eu.etaxonomy.cdm.model.media.Rights; |
29 | 29 |
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer; |
30 |
import eu.etaxonomy.cdm.persistence.dto.UuidAndTitleCache; |
|
31 | 30 |
import eu.etaxonomy.cdm.persistence.query.MatchMode; |
32 | 31 |
import eu.etaxonomy.cdm.persistence.query.OrderHint; |
33 | 32 |
import eu.etaxonomy.cdm.strategy.cache.common.IIdentifiableEntityCacheStrategy; |
... | ... | |
100 | 99 |
*/ |
101 | 100 |
public Pager<Rights> getRights(T t, Integer pageSize, Integer pageNumber, List<String> propertyPaths); |
102 | 101 |
|
103 |
/** |
|
104 |
* Return a list of all uuids mapped to titleCache in the convenient <code>UuidAndTitleCache</code> object. |
|
105 |
* Retrieving this list is considered to be significantly faster than initializing the fully fledged business |
|
106 |
* objects. To be used in cases where you want to present large amount of data and provide details after |
|
107 |
* a selection has been made. |
|
108 |
* |
|
109 |
* @return a list of <code>UuidAndTitleCache</code> instances |
|
110 |
* |
|
111 |
* @see #getUuidAndTitleCache(Class, Integer, String) |
|
112 |
*/ |
|
113 |
public List<UuidAndTitleCache<T>> getUuidAndTitleCache(Integer limit, String pattern); |
|
114 | 102 |
|
115 | 103 |
/** |
116 | 104 |
* Returns the titleCache for a given object defined by uuid. |
... | ... | |
121 | 109 |
*/ |
122 | 110 |
public String getTitleCache(UUID uuid, boolean refresh); |
123 | 111 |
|
124 |
/** |
|
125 |
* Like {@link #getUuidAndTitleCache(Integer, String)} but searching only on a subclass |
|
126 |
* of the type handled by the DAO. |
|
127 |
* |
|
128 |
* @param clazz the (sub)class |
|
129 |
* @param limit max number of results |
|
130 |
* @param pattern search pattern |
|
131 | 112 |
|
132 |
* @see #getUuidAndTitleCache(Integer, String) |
|
133 |
*/ |
|
134 |
public <S extends T> List<UuidAndTitleCache<S>> getUuidAndTitleCache(Class<S> clazz, Integer limit, String pattern); |
|
135 | 113 |
|
136 | 114 |
/** |
137 | 115 |
* Return a Pager of objects matching the given query string, optionally filtered by class, optionally with a particular MatchMode |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/molecular/AmplificationServiceImpl.java | ||
---|---|---|
45 | 45 |
} |
46 | 46 |
|
47 | 47 |
@Override |
48 |
public List<UuidAndTitleCache<Amplification>> getAmplificationUuidAndLabelCache() { |
|
49 |
return dao.getAmplificationUuidAndLabelCache(); |
|
48 |
public List<UuidAndTitleCache<Amplification>> getAmplificationUuidAndLabelCache(Integer limit, String pattern) {
|
|
49 |
return dao.getAmplificationUuidAndLabelCache(limit, pattern);
|
|
50 | 50 |
} |
51 | 51 |
|
52 | 52 |
@Override |
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/molecular/IAmplificationService.java | ||
---|---|---|
33 | 33 |
* {@link Amplification}s found in the data base. |
34 | 34 |
* @return a list of {@link UuidAndTitleCache} |
35 | 35 |
*/ |
36 |
public List<UuidAndTitleCache<Amplification>> getAmplificationUuidAndLabelCache(); |
|
36 |
public List<UuidAndTitleCache<Amplification>> getAmplificationUuidAndLabelCache(Integer limit, String pattern);
|
|
37 | 37 |
|
38 | 38 |
/** |
39 | 39 |
* Return a List of {@link Amplification}s matching the given query string, optionally with a particular MatchMode |
Also available in: Unified diff
adapt uuidAndTitleCache services and dao methods to search for a pattern