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
|
|
13
|
import java.util.List;
|
14
|
import java.util.Map;
|
15
|
import java.util.Set;
|
16
|
import java.util.UUID;
|
17
|
|
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;
|
22
|
|
23
|
|
24
|
/**
|
25
|
* @author a.mueller
|
26
|
*
|
27
|
*/
|
28
|
public interface ITermVocabularyDao extends IIdentifiableDao<TermVocabulary> {
|
29
|
|
30
|
/**
|
31
|
* Return a count of terms that belong to the termVocabulary supplied
|
32
|
*
|
33
|
* @param termVocabulary The term vocabulary which 'owns' the terms of interest
|
34
|
* @return a count of terms
|
35
|
*/
|
36
|
public int countTerms(TermVocabulary termVocabulary);
|
37
|
|
38
|
/**
|
39
|
* Return a List of terms that belong to the termVocabulary supplied
|
40
|
*
|
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
|
45
|
*/
|
46
|
public <T extends DefinedTermBase> List<T> getTerms(TermVocabulary<T> termVocabulary, Integer pageSize, Integer pageNumber);
|
47
|
|
48
|
public <T extends DefinedTermBase> TermVocabulary<T> findByUri(String termSourceUri, Class<T> clazz);
|
49
|
|
50
|
/**
|
51
|
* Return a List of terms that belong to the termVocabulary supplied
|
52
|
*
|
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)
|
56
|
* @param orderHints
|
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
|
62
|
*/
|
63
|
public <T extends DefinedTermBase> List<T> getTerms(TermVocabulary<T> vocabulary,Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
64
|
|
65
|
/**
|
66
|
* Returns term vocabularies that contain terms of a certain class e.g. Feature, Modifier, State.
|
67
|
*
|
68
|
* @param <TERMCLASS>
|
69
|
* @param clazz the term class of the terms in the vocabulary
|
70
|
* @param includeSubclasses if <code>true</code> all subclasses of clazz will be included for computation of the result
|
71
|
* @param includeEmptyVocs if <code>true</code> all vocabularies that do not contain any term will be included in the result
|
72
|
* @param limit The maximum number of vocabularies returned (can be null for all vocabularies)
|
73
|
* @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)
|
74
|
* @param orderHints
|
75
|
* Supports path like <code>orderHints.propertyNames</code> which
|
76
|
* include *-to-one properties like createdBy.username or
|
77
|
* authorTeam.persistentTitleCache
|
78
|
* @param propertyPaths properties to be initialized
|
79
|
* @return a list of term vocabularies
|
80
|
*/
|
81
|
/**
|
82
|
* @deprecated This method is deprecated as we are using {@link TermType} now.
|
83
|
* It may be removed in a future version.
|
84
|
*/
|
85
|
@Deprecated
|
86
|
public <TERMCLASS extends DefinedTermBase> List<TermVocabulary<? extends TERMCLASS>> listByTermClass(Class<TERMCLASS> clazz, boolean includeSubclasses, boolean includeEmptyVocs, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
|
87
|
|
88
|
|
89
|
/**
|
90
|
* Return a List of vocabularies that belong to the term type supplied
|
91
|
*
|
92
|
* @param termType The term type corresponding to the vocabularies of interest
|
93
|
* @return a List of vocabularies
|
94
|
*/
|
95
|
public <T extends DefinedTermBase> List<TermVocabulary<T>> findByTermType(TermType termType);
|
96
|
|
97
|
|
98
|
/**
|
99
|
* Returns term vocabularies that contain terms of a certain {@link TermType} e.g. Feature, Modifier, State.
|
100
|
*
|
101
|
* @param <TERMTYPE>
|
102
|
* @param termType the {@link TermType} of the terms in the vocabulary and of the vocabulary
|
103
|
* @param includeSubtypes if <code>true</code> all subtypes will be included for computation of the result
|
104
|
* @param limit The maximum number of vocabularies returned (can be null for all vocabularies)
|
105
|
* @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)
|
106
|
* @param orderHints
|
107
|
* Supports path like <code>orderHints.propertyNames</code> which
|
108
|
* include *-to-one properties like createdBy.username or
|
109
|
* authorTeam.persistentTitleCache
|
110
|
* @param propertyPaths properties to be initialized
|
111
|
* @return a list of term vocabularies
|
112
|
*/
|
113
|
public List<TermVocabulary> listByTermType(TermType termType, boolean includeSubtypes, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
|
114
|
|
115
|
/**
|
116
|
* Returns all empty vocabularies.
|
117
|
* @param limit
|
118
|
* @param start
|
119
|
* @param orderHints
|
120
|
* @param propertyPaths
|
121
|
* @return
|
122
|
*/
|
123
|
public List<TermVocabulary> listEmpty(Integer limit, Integer start,List<OrderHint> orderHints, List<String> propertyPaths);
|
124
|
|
125
|
/**
|
126
|
* Fills the response map with those term uuids which do exist in the requested map
|
127
|
* but not in the repository (missing terms). The map key is the vocabulary uuid in both cases.
|
128
|
* If parameter vocabularyRepsonse is not <code>null</code> the vocabularies will be fully loaded
|
129
|
* and returned within the map. The later is for using this method together with fast termloading.
|
130
|
* @param uuidsRequested
|
131
|
* @param uuidsRepsonse
|
132
|
* @param vocabularyResponse
|
133
|
*/
|
134
|
public void missingTermUuids(Map<UUID, Set<UUID>> uuidsRequested,
|
135
|
Map<UUID, Set<UUID>> uuidsRepsonse,
|
136
|
Map<UUID, TermVocabulary<?>> vocabularyResponse);
|
137
|
|
138
|
}
|