remove old TermsDataSet
[cdmlib.git] / cdmlib-persistence / src / main / java / eu / etaxonomy / cdm / persistence / dao / common / IAnnotatableDao.java
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.IBeanInitializer;
19 import eu.etaxonomy.cdm.persistence.query.Grouping;
20 import eu.etaxonomy.cdm.persistence.query.OrderHint;
21
22 /**
23 * @author n.hoffmann
24 * @created 24.09.2008
25 * @version 1.0
26 */
27 public interface IAnnotatableDao<T extends AnnotatableEntity> extends IVersionableDao<T>{
28
29 /**
30 * Returns a List of Annotations belonging to the supplied AnnotatableEntity
31 *
32 * @param annotatableEntity the entity which is annotated
33 * @param status The status of the annotations (null to return annotations regardless of status)
34 * @param pageSize The maximum number of annotations returned (can be null for all annotations)
35 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
36 * @param orderHints may be null
37 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
38 * @return a List of Annotation instances
39 */
40 public List<Annotation> getAnnotations(T annotatableEntity, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
41
42 /**
43 * Returns a count of Annotations belonging to the supplied AnnotatableEntity
44 *
45 * @param annotatableEntity the entity which is annotated
46 * @param status The status of the annotations (null to count all annotations regardless of status)
47 * @return a count of Annotation instances
48 */
49 public int countAnnotations(T annotatableEntity, MarkerType status);
50
51 /**
52 * Returns a count of Markers belonging to the supplied AnnotatableEntity
53 *
54 * @param annotatableEntity the entity which is marked
55 * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
56 * @return a count of Marker instances
57 */
58 public int countMarkers(T annotatableEntity, Boolean technical);
59
60 /**
61 *
62 * @param annotatableEntity the entity which is marked
63 * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
64 * @param pageSize The maximum number of markers returned (can be null for all markers)
65 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
66 * @param orderHints may be null
67 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
68 * @return a List of Marker instances
69 */
70 public List<Marker> getMarkers(T annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
71 /**
72 * Returns a list of arrays representing counts of entities of type clazz, grouped by their markerTypes. The arrays have two elements.
73 * The first element is the MarkerType, initialized using the propertyPaths parameter. The second element is the count of all markers of Objects
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
75 * titleCache of the markerType, in ascending order.
76 *
77 * @param clazz optionally restrict the markers to those belonging to this class
78 * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
79 * @param pageSize The maximum number of arrays returned (can be null for all arrays)
80 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
81 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
82 * @return
83 */
84 public List<Object[]> groupMarkers(Class<? extends T> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
85
86 /**
87 * returns a count of all markers belonging to that clazz, optionally filtered to include only technical or only non-technical markers.
88 *
89 * @param clazz optionally restrict the markers to those belonging to this class
90 * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
91 * @return a count of markers
92 */
93 public int countMarkers(Class<? extends T> clazz, Boolean technical);
94 }