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.
9 package eu
.etaxonomy
.cdm
.persistence
.dao
.name
;
11 import java
.util
.List
;
12 import java
.util
.UUID
;
14 import org
.hibernate
.criterion
.Criterion
;
16 import eu
.etaxonomy
.cdm
.model
.common
.IdentifiableEntity
;
17 import eu
.etaxonomy
.cdm
.model
.common
.RelationshipBase
;
18 import eu
.etaxonomy
.cdm
.model
.common
.UuidAndTitleCache
;
19 import eu
.etaxonomy
.cdm
.model
.name
.HybridRelationship
;
20 import eu
.etaxonomy
.cdm
.model
.name
.HybridRelationshipType
;
21 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationship
;
22 import eu
.etaxonomy
.cdm
.model
.name
.NameRelationshipType
;
23 import eu
.etaxonomy
.cdm
.model
.name
.NonViralName
;
24 import eu
.etaxonomy
.cdm
.model
.name
.Rank
;
25 import eu
.etaxonomy
.cdm
.model
.name
.SpecimenTypeDesignationStatus
;
26 import eu
.etaxonomy
.cdm
.model
.name
.TaxonNameBase
;
27 import eu
.etaxonomy
.cdm
.model
.name
.TypeDesignationBase
;
28 import eu
.etaxonomy
.cdm
.model
.name
.TypeDesignationStatusBase
;
29 import eu
.etaxonomy
.cdm
.model
.name
.ZoologicalName
;
30 import eu
.etaxonomy
.cdm
.persistence
.dao
.common
.IIdentifiableDao
;
31 import eu
.etaxonomy
.cdm
.persistence
.dao
.initializer
.IBeanInitializer
;
32 import eu
.etaxonomy
.cdm
.persistence
.query
.MatchMode
;
33 import eu
.etaxonomy
.cdm
.persistence
.query
.OrderHint
;
39 public interface ITaxonNameDao
extends IIdentifiableDao
<TaxonNameBase
> {
42 * Return a count of names related to or from this name, optionally filtered
43 * by relationship type. The direction of the relationships taken in to account is depending on
44 * the <code>direction</code> parameter.
49 * specifies the direction of the relationship
51 * the relationship type (or null to return all relationships)
52 * @return a count of NameRelationship instances
54 public int countNameRelationships(TaxonNameBase name
, NameRelationship
.Direction direction
, NameRelationshipType type
);
57 * Return a List of relationships related to or from this name, optionally filtered
58 * by relationship type. The direction of the relationships taken in to account is depending on
59 * the <code>direction</code> parameter.
60 * If both name and direction is null all name relationships will be returned.
65 * specifies the direction of the relationship, may be null to return all relationships
67 * the relationship type (or null to return all relationships)
69 * The maximum number of relationships returned (can be null for
72 * The offset (in pageSize chunks) from the start of the result
73 * set (0 - based) of the result set (0 - based)
74 * @param orderHints may be null
75 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
76 * @return a List of NameRelationship instances
78 public List
<NameRelationship
> getNameRelationships(TaxonNameBase name
, NameRelationship
.Direction direction
,
79 NameRelationshipType type
, Integer pageSize
, Integer pageNumber
, List
<OrderHint
> orderHints
,
80 List
<String
> propertyPaths
);
83 * Return a count of hybrids related to this name, optionally filtered by
84 * hybrid relationship type
89 * the hybrid relationship type (or null to return all hybrid)
90 * @return a count of HybridRelationship instances
92 public int countHybridNames(NonViralName name
, HybridRelationshipType type
);
95 * Return a List of hybrids related to this name, optionally filtered by
96 * hybrid relationship type
101 * the hybrid relationship type (or null to return all hybrids)
103 * The maximum number of hybrid relationships returned (can be
104 * null for all relationships)
106 * The offset (in pageSize chunks) from the start of the result
108 * @return a List of HybridRelationship instances
110 public List
<HybridRelationship
> getHybridNames(NonViralName name
, HybridRelationshipType type
, Integer pageSize
, Integer pageNumber
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
113 * Return a count of types related to this name, optionally filtered by type
119 * the type designation status (or null to return all types)
120 * @return a count of TypeDesignationBase instances
122 public int countTypeDesignations(TaxonNameBase name
,
123 SpecimenTypeDesignationStatus status
);
126 * Return a List of types related to this name, optionally filtered by type
132 * limit the result set to a specific subtype of TypeDesignationBase, may be null
134 * the type designation status (or null to return all types)
136 * The maximum number of types returned (can be null for all
139 * The offset (in pageSize chunks) from the start of the result
141 * @param propertyPaths
142 * @return a List of TypeDesignationBase instances
144 public <T
extends TypeDesignationBase
> List
<T
> getTypeDesignations(TaxonNameBase name
,
146 TypeDesignationStatusBase status
, Integer pageSize
, Integer pageNumber
,
147 List
<String
> propertyPaths
);
150 * Return a List of types related to this name, optionally filtered by type
156 * the type designation status (or null to return all types)
158 * The maximum number of types returned (can be null for all
161 * The offset (in pageSize chunks) from the start of the result
163 * @param propertyPaths
164 * @return a List of TypeDesignationBase instances
165 * @deprecated use {@link #getTypeDesignations(TaxonNameBase, Class, TypeDesignationStatusBase, Integer, Integer, List)} instead
168 public List
<TypeDesignationBase
> getTypeDesignations(TaxonNameBase name
,
169 TypeDesignationStatusBase status
, Integer pageSize
, Integer pageNumber
,
170 List
<String
> propertyPaths
);
173 * Returns a List of TaxonNameBase instances that match the properties
177 * @param infraGenericEpithet
178 * @param specificEpithet
179 * @param infraspecificEpithet
182 * The maximum number of names returned (can be null for all
185 * The offset (in pageSize chunks) from the start of the result
187 * @param propertyPaths
189 * @return a List of TaxonNameBase instances
191 public List
<TaxonNameBase
> searchNames(String uninomial
,
192 String infraGenericEpithet
, String specificEpithet
,
193 String infraspecificEpithet
, Rank rank
, Integer pageSize
,
194 Integer pageNumber
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
197 * Returns a count of TaxonNameBase instances that match the properties
201 * @param infraGenericEpithet
202 * @param specificEpithet
203 * @param infraspecificEpithet
205 * @return a count of TaxonNameBase instances
207 public int countNames(String uninomial
, String infraGenericEpithet
,
208 String specificEpithet
, String infraspecificEpithet
, Rank rank
);
211 * Returns a count of TaxonNameBase instances that match the properties passed
217 public int countNames(String queryString
, MatchMode matchMode
, List
<Criterion
> criteria
);
220 * Returns a List of TaxonNameBase instances which nameCache matches the
225 * The maximum number of names returned (can be null for all
228 * The offset (in pageSize chunks) from the start of the result
230 * @return a List of TaxonNameBase instances
232 public List
<TaxonNameBase
<?
, ?
>> searchNames(String queryString
,
233 Integer pageSize
, Integer pageNumber
);
238 * Returns a count of TaxonNameBase instances which nameCache matches the
242 * @return a count of TaxonNameBase instances
244 public int countNames(String queryString
);
252 * @param propertyPaths TODO
255 public List
<?
extends TaxonNameBase
<?
, ?
>> findByName(String queryString
,
256 MatchMode matchmode
, Integer pageSize
, Integer pageNumber
,
257 List
<Criterion
> criteria
, List
<String
> propertyPaths
);
265 * @param propertyPaths TODO
268 public List
<?
extends TaxonNameBase
<?
, ?
>> findByTitle(String queryString
,
269 MatchMode matchmode
, Integer pageSize
, Integer pageNumber
,
270 List
<Criterion
> criteria
, List
<String
> propertyPaths
);
273 * Returns a taxon name corresponding to the given uuid
276 * The uuid of the taxon name requested
278 * Custom criteria to be added to the default list of applied criteria.
279 * @param propertyPaths
283 public TaxonNameBase
<?
, ?
> findByUuid(UUID uuid
, List
<Criterion
> criteria
, List
<String
> propertyPaths
);
291 public Integer
countByName(String queryString
,
292 MatchMode matchmode
, List
<Criterion
> criteria
);
294 public List
<RelationshipBase
> getAllRelationships(Integer limit
, Integer start
);
296 public List
<UuidAndTitleCache
> getUuidAndTitleCacheOfNames();
306 * @param propertyPaths TODO
309 public List
<TaxonNameBase
> findByName(Class
<?
extends TaxonNameBase
> clazz
, String queryString
, MatchMode matchmode
, List
<Criterion
> criteria
,Integer pageSize
, Integer pageNumber
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
318 public Integer
countByName(Class
<?
extends TaxonNameBase
> clazz
, String queryString
, MatchMode matchmode
, List
<Criterion
> criteria
);
320 public List
<ZoologicalName
> getZoologicalNames(Integer limit
, Integer start
);
322 public ZoologicalName
findZoologicalNameByUUID(UUID uuid
);