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
;
13 import java
.util
.List
;
16 import java
.util
.UUID
;
18 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
19 import eu
.etaxonomy
.cdm
.model
.common
.TermType
;
20 import eu
.etaxonomy
.cdm
.model
.common
.TermVocabulary
;
21 import eu
.etaxonomy
.cdm
.persistence
.query
.OrderHint
;
28 public interface ITermVocabularyDao
extends IIdentifiableDao
<TermVocabulary
> {
31 * Return a count of terms that belong to the termVocabulary supplied
33 * @param termVocabulary The term vocabulary which 'owns' the terms of interest
34 * @return a count of terms
36 public int countTerms(TermVocabulary termVocabulary
);
39 * Return a List of terms that belong to the termVocabulary supplied
41 * @param termVocabulary The term vocabulary which 'owns' the terms of interest
42 * @param pageSize The maximum number of terms returned (can be null for all terms)
43 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
44 * @return a List of terms
46 public <T
extends DefinedTermBase
> List
<T
> getTerms(TermVocabulary
<T
> termVocabulary
, Integer pageSize
, Integer pageNumber
);
48 public <T
extends DefinedTermBase
> TermVocabulary
<T
> findByUri(String termSourceUri
, Class
<T
> clazz
);
51 * Return a List of terms that belong to the termVocabulary supplied
53 * @param termVocabulary The term vocabulary which 'owns' the terms of interest
54 * @param pageSize The maximum number of terms returned (can be null for all terms)
55 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
57 * Supports path like <code>orderHints.propertyNames</code> which
58 * include *-to-one properties like createdBy.username or
59 * authorTeam.persistentTitleCache
60 * @param propertyPaths properties to be initialized
61 * @return a List of terms
63 public <T
extends DefinedTermBase
> List
<T
> getTerms(TermVocabulary
<T
> vocabulary
,Integer pageSize
, Integer pageNumber
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
66 * Return a List of vocabularies that belong to the term type supplied
68 * @param termType The term type corresponding to the vocabularies of interest
69 * @return a List of vocabularies
71 public <T
extends DefinedTermBase
> List
<TermVocabulary
<T
>> findByTermType(TermType termType
);
75 * Returns term vocabularies that contain terms of a certain {@link TermType} e.g. Feature, Modifier, State.
78 * @param termType the {@link TermType} of the terms in the vocabulary and of the vocabulary
79 * @param includeSubtypes if <code>true</code> all subtypes will be included for computation of the result
80 * @param limit The maximum number of vocabularies returned (can be null for all vocabularies)
81 * @param start The offset from the start of the result set (0 - based, can be null - equivalent of starting at the beginning of the recordset)
83 * Supports path like <code>orderHints.propertyNames</code> which
84 * include *-to-one properties like createdBy.username or
85 * authorTeam.persistentTitleCache
86 * @param propertyPaths properties to be initialized
87 * @return a list of term vocabularies
89 public List
<TermVocabulary
> listByTermType(TermType termType
, boolean includeSubtypes
, Integer limit
, Integer start
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
92 * Fills the response map with those term uuids which do exist in the requested map
93 * but not in the repository (missing terms). The map key is the vocabulary uuid in both cases.
94 * If parameter vocabularyRepsonse is not <code>null</code> the vocabularies will be fully loaded
95 * and returned within the map. The later is for using this method together with fast termloading.
96 * @param uuidsRequested
97 * @param uuidsRepsonse
98 * @param vocabularyResponse
100 public void missingTermUuids(Map
<UUID
, Set
<UUID
>> uuidsRequested
,
101 Map
<UUID
, Set
<UUID
>> uuidsRepsonse
,
102 Map
<UUID
, TermVocabulary
<?
>> vocabularyResponse
);