2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.persistence
.dao
.common
;
12 import java
.util
.List
;
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
.Grouping
;
20 import eu
.etaxonomy
.cdm
.persistence
.query
.OrderHint
;
27 public interface IAnnotatableDao
<T
extends AnnotatableEntity
> extends IVersionableDao
<T
>{
30 * Returns a List of Annotations belonging to the supplied AnnotatableEntity
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
40 public List
<Annotation
> getAnnotations(T annotatableEntity
, MarkerType status
, Integer pageSize
, Integer pageNumber
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
43 * Returns a count of Annotations belonging to the supplied AnnotatableEntity
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
49 public int countAnnotations(T annotatableEntity
, MarkerType status
);
52 * Returns a count of Markers belonging to the supplied AnnotatableEntity
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
58 public int countMarkers(T annotatableEntity
, Boolean technical
);
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
70 public List
<Marker
> getMarkers(T annotatableEntity
, Boolean technical
, Integer pageSize
, Integer pageNumber
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
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.
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)}
84 public List
<Object
[]> groupMarkers(Class
<?
extends T
> clazz
, Boolean technical
, Integer pageSize
, Integer pageNumber
, List
<String
> propertyPaths
);
87 * returns a count of all markers belonging to that clazz, optionally filtered to include only technical or only non-technical markers.
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
93 public int countMarkers(Class
<?
extends T
> clazz
, Boolean technical
);