1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.cdm.persistence.dao.common;
|
11
|
|
12
|
import java.util.List;
|
13
|
|
14
|
import eu.etaxonomy.cdm.model.common.AnnotatableEntity;
|
15
|
import eu.etaxonomy.cdm.model.common.Annotation;
|
16
|
import eu.etaxonomy.cdm.model.common.MarkerType;
|
17
|
import eu.etaxonomy.cdm.model.common.Marker;
|
18
|
import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
|
19
|
import eu.etaxonomy.cdm.persistence.query.OrderHint;
|
20
|
|
21
|
/**
|
22
|
* @author n.hoffmann
|
23
|
* @created 24.09.2008
|
24
|
* @version 1.0
|
25
|
*/
|
26
|
public interface IAnnotatableDao<T extends AnnotatableEntity> extends IVersionableDao<T>{
|
27
|
|
28
|
/**
|
29
|
* Returns a List of Annotations belonging to the supplied AnnotatableEntity
|
30
|
*
|
31
|
* @param annotatableEntity the entity which is annotated
|
32
|
* @param status The status of the annotations (null to return annotations regardless of status)
|
33
|
* @param pageSize The maximum number of annotations returned (can be null for all annotations)
|
34
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
35
|
* @param orderHints may be null
|
36
|
* @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
|
37
|
* @return a List of Annotation instances
|
38
|
*/
|
39
|
public List<Annotation> getAnnotations(T annotatableEntity, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
40
|
|
41
|
/**
|
42
|
* Returns a count of Annotations belonging to the supplied AnnotatableEntity
|
43
|
*
|
44
|
* @param annotatableEntity the entity which is annotated
|
45
|
* @param status The status of the annotations (null to count all annotations regardless of status)
|
46
|
* @return a count of Annotation instances
|
47
|
*/
|
48
|
public int countAnnotations(T annotatableEntity, MarkerType status);
|
49
|
|
50
|
/**
|
51
|
* Returns a count of Markers belonging to the supplied AnnotatableEntity
|
52
|
*
|
53
|
* @param annotatableEntity the entity which is marked
|
54
|
* @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
|
55
|
* @return a count of Marker instances
|
56
|
*/
|
57
|
public int countMarkers(T annotatableEntity, Boolean technical);
|
58
|
|
59
|
/**
|
60
|
*
|
61
|
* @param annotatableEntity the entity which is marked
|
62
|
* @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
|
63
|
* @param pageSize The maximum number of markers returned (can be null for all markers)
|
64
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
65
|
* @param orderHints may be null
|
66
|
* @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
|
67
|
* @return a List of Marker instances
|
68
|
*/
|
69
|
public List<Marker> getMarkers(T annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
70
|
/**
|
71
|
* Returns a list of arrays representing counts of entities of type clazz, grouped by their markerTypes. The arrays have two elements.
|
72
|
* The first element is the MarkerType, initialized using the propertyPaths parameter. The second element is the count of all markers of Objects
|
73
|
* 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
|
* titleCache of the markerType, in ascending order.
|
75
|
*
|
76
|
* @param clazz optionally restrict the markers to those belonging to this class
|
77
|
* @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
|
78
|
* @param pageSize The maximum number of arrays returned (can be null for all arrays)
|
79
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
80
|
* @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
|
81
|
* @return
|
82
|
*/
|
83
|
public List<Object[]> groupMarkers(Class<? extends T> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
84
|
|
85
|
/**
|
86
|
* returns a count of all markers belonging to that clazz, optionally filtered to include only technical or only non-technical markers.
|
87
|
*
|
88
|
* @param clazz optionally restrict the markers to those belonging to this class
|
89
|
* @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
|
90
|
* @return a count of markers
|
91
|
*/
|
92
|
public int countMarkers(Class<? extends T> clazz, Boolean technical);
|
93
|
}
|