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
.Marker
;
17 import eu
.etaxonomy
.cdm
.model
.common
.MarkerType
;
18 import eu
.etaxonomy
.cdm
.persistence
.dao
.initializer
.IBeanInitializer
;
19 import eu
.etaxonomy
.cdm
.persistence
.query
.OrderHint
;
25 public interface IAnnotatableDao
<T
extends AnnotatableEntity
> extends IVersionableDao
<T
>{
28 * Returns a List of Annotations belonging to the supplied AnnotatableEntity
30 * @param annotatableEntity the entity which is annotated
31 * @param status The status of the annotations (null to return annotations regardless of status)
32 * @param pageSize The maximum number of annotations returned (can be null for all annotations)
33 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
34 * @param orderHints may be null
35 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
36 * @return a List of Annotation instances
38 public List
<Annotation
> getAnnotations(T annotatableEntity
, MarkerType status
, Integer pageSize
, Integer pageNumber
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
41 * Returns a count of Annotations belonging to the supplied AnnotatableEntity
43 * @param annotatableEntity the entity which is annotated
44 * @param status The status of the annotations (null to count all annotations regardless of status)
45 * @return a count of Annotation instances
47 public long countAnnotations(T annotatableEntity
, MarkerType status
);
50 * Returns a count of Markers belonging to the supplied AnnotatableEntity
52 * @param annotatableEntity the entity which is marked
53 * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
54 * @return a count of Marker instances
56 public long countMarkers(T annotatableEntity
, Boolean technical
);
60 * @param annotatableEntity the entity which is marked
61 * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
62 * @param pageSize The maximum number of markers returned (can be null for all markers)
63 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
64 * @param orderHints may be null
65 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
66 * @return a List of Marker instances
68 public List
<Marker
> getMarkers(T annotatableEntity
, Boolean technical
, Integer pageSize
, Integer pageNumber
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
70 * Returns a list of arrays representing counts of entities of type clazz, grouped by their markerTypes. The arrays have two elements.
71 * The first element is the MarkerType, initialized using the propertyPaths parameter. The second element is the count of all markers of Objects
72 * 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
73 * titleCache of the markerType, in ascending order.
75 * @param clazz optionally restrict the markers to those belonging to this class
76 * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
77 * @param pageSize The maximum number of arrays returned (can be null for all arrays)
78 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
79 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
82 public List
<Object
[]> groupMarkers(Class
<?
extends T
> clazz
, Boolean technical
, Integer pageSize
, Integer pageNumber
, List
<String
> propertyPaths
);
85 * returns a count of all markers belonging to that clazz, optionally filtered to include only technical or only non-technical markers.
87 * @param clazz optionally restrict the markers to those belonging to this class
88 * @param technical The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
89 * @return a count of markers
91 public int countMarkers(Class
<?
extends T
> clazz
, Boolean technical
);