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
|
import java.util.Enumeration;
|
13
|
import java.util.List;
|
14
|
import java.util.Locale;
|
15
|
import java.util.Set;
|
16
|
|
17
|
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
|
18
|
import eu.etaxonomy.cdm.model.common.Language;
|
19
|
import eu.etaxonomy.cdm.model.common.TermVocabulary;
|
20
|
import eu.etaxonomy.cdm.model.description.AbsenceTerm;
|
21
|
import eu.etaxonomy.cdm.model.description.PresenceTerm;
|
22
|
import eu.etaxonomy.cdm.model.location.NamedArea;
|
23
|
import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
|
24
|
import eu.etaxonomy.cdm.model.location.NamedAreaType;
|
25
|
import eu.etaxonomy.cdm.model.location.WaterbodyOrCountry;
|
26
|
import eu.etaxonomy.cdm.model.media.Media;
|
27
|
import eu.etaxonomy.cdm.persistence.dao.BeanInitializer;
|
28
|
import eu.etaxonomy.cdm.persistence.query.OrderHint;
|
29
|
|
30
|
|
31
|
public interface IDefinedTermDao extends IIdentifiableDao<DefinedTermBase>, ITitledDao<DefinedTermBase>{
|
32
|
|
33
|
/**
|
34
|
* @param iso639 a two or three letter language code according to iso639-1 or iso639-2
|
35
|
* @return the Language or null
|
36
|
*/
|
37
|
//TODO refactor typo:
|
38
|
public Language getLanguageByIso(String iso639);
|
39
|
|
40
|
public List<Language> getLanguagesByIso(List<String> iso639List);
|
41
|
|
42
|
public List<Language> getLanguagesByLocale(Enumeration<Locale> locales);
|
43
|
|
44
|
public WaterbodyOrCountry getCountryByIso(String iso639);
|
45
|
|
46
|
public <TYPE extends DefinedTermBase> List<TYPE> getDefinedTermByRepresentationText(String text, Class<TYPE> clazz );
|
47
|
|
48
|
public <TYPE extends DefinedTermBase> List<TYPE> getDefinedTermByRepresentationText(String text, Class<TYPE> clazz, Integer pageSize,Integer pageNumber);
|
49
|
|
50
|
public int countDefinedTermByRepresentationText(String text, Class<? extends DefinedTermBase> clazz);
|
51
|
|
52
|
public <TYPE extends DefinedTermBase> List<TYPE> getDefinedTermByRepresentationAbbrev(String text, Class<TYPE> clazz, Integer pageSize,Integer pageNumber);
|
53
|
|
54
|
public int countDefinedTermByRepresentationAbbrev(String text, Class<? extends DefinedTermBase> clazz);
|
55
|
|
56
|
|
57
|
/**
|
58
|
* Returns a List of Media that represent a given DefinedTerm instance
|
59
|
*
|
60
|
* @param definedTerm the definedTerm represented by these media
|
61
|
* @param pageSize The maximum number of media returned (can be null for all related media)
|
62
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
63
|
* @return a List of media instances
|
64
|
*/
|
65
|
public List<Media> getMedia(DefinedTermBase definedTerm, Integer pageSize, Integer pageNumber);
|
66
|
|
67
|
/**
|
68
|
* Returns a count of the Media that represent a given
|
69
|
* DefinedTermBase instance
|
70
|
*
|
71
|
* @param definedTerm the definedTerm represented by these media
|
72
|
* @return a count of Media entities
|
73
|
*/
|
74
|
public int countMedia(DefinedTermBase definedTerm);
|
75
|
|
76
|
/**
|
77
|
* Returns a List of NamedArea instances (optionally filtered by type or level)
|
78
|
*
|
79
|
* @param level restrict the result set to named areas of a certain level (can be null)
|
80
|
* @param type restrict the result set to named areas of a certain type (can be null)
|
81
|
* @param pageSize The maximum number of namedAreas returned (can be null for all named areas)
|
82
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
83
|
* @return a List of named areas
|
84
|
*/
|
85
|
public List<NamedArea> list(NamedAreaLevel level, NamedAreaType type, Integer pageSize, Integer pageNumber);
|
86
|
|
87
|
/**
|
88
|
* @param level
|
89
|
* @param type
|
90
|
* @param pageSize
|
91
|
* @param pageNumber
|
92
|
* @param orderHints
|
93
|
* @param propertyPaths
|
94
|
* @return
|
95
|
*/
|
96
|
public List<NamedArea> list(NamedAreaLevel level, NamedAreaType type, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths);
|
97
|
|
98
|
|
99
|
/**
|
100
|
* Returns a count of NamedArea instances (optionally filtered by type or level)
|
101
|
*
|
102
|
* @param level restrict the result set to named areas of a certain level (can be null)
|
103
|
* @param type restrict the result set to named areas of a certain type (can be null)
|
104
|
* @return a count of named areas
|
105
|
*/
|
106
|
public int count(NamedAreaLevel level, NamedAreaType type);
|
107
|
|
108
|
/**
|
109
|
* Return a list of terms which are specializations of a given definedTerm
|
110
|
*
|
111
|
* @param definedTerm The term which is a generalization of the terms returned
|
112
|
* @param pageSize The maximum number of terms returned (can be null for all specializations)
|
113
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
114
|
* @return a List of DefinedTerms
|
115
|
*/
|
116
|
public <T extends DefinedTermBase> List<T> getGeneralizationOf(T definedTerm, Integer pageSize, Integer pageNumber);
|
117
|
|
118
|
/**
|
119
|
* Return a count of terms which are specializations of a given definedTerm
|
120
|
*
|
121
|
* @param definedTerm The term which is a generalization of the terms returned
|
122
|
* @return a count of DefinedTerms
|
123
|
*/
|
124
|
public <T extends DefinedTermBase> int countGeneralizationOf(T definedTerm);
|
125
|
|
126
|
/**
|
127
|
* Return a List of distinct terms which include the terms supplied
|
128
|
*
|
129
|
* @param definedTerms the set of terms which are part of the terms of interest
|
130
|
* @param pageSize The maximum number of terms returned (can be null for all terms)
|
131
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
132
|
* @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
|
133
|
* @return a List of DefinedTerms
|
134
|
*/
|
135
|
public <T extends DefinedTermBase> List<T> getPartOf(Set<T> definedTerms, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
136
|
|
137
|
/**
|
138
|
* Return a count of distinct terms which include the terms supplied
|
139
|
*
|
140
|
* @param definedTerms the set of terms which are part of the terms of interest
|
141
|
* @return a count of DefinedTerms
|
142
|
*/
|
143
|
public <T extends DefinedTermBase> int countPartOf(Set<T> definedTerms);
|
144
|
|
145
|
/**
|
146
|
* Return a List of terms which are part of the terms supplied
|
147
|
*
|
148
|
* @param definedTerms the set of terms which include the terms of interest
|
149
|
* @param pageSize The maximum number of terms returned (can be null for all terms)
|
150
|
* @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
|
151
|
* @param propertyPaths properties to initialize - see {@link BeanInitializer#initialize(Object, List)}
|
152
|
* @return a List of DefinedTerms
|
153
|
*/
|
154
|
public <T extends DefinedTermBase> List<T> getIncludes(Set<T> definedTerms, Integer pageSize, Integer pageNumber, List<String> propertyPaths);
|
155
|
|
156
|
/**
|
157
|
* Return a count of terms which are part of the terms supplied
|
158
|
*
|
159
|
* @param definedTerms the set of terms which include the terms of interest
|
160
|
* @return a count of DefinedTerms
|
161
|
*/
|
162
|
public <T extends DefinedTermBase> int countIncludes(Set<T> definedTerms);
|
163
|
|
164
|
public DefinedTermBase findByUri(String uri);
|
165
|
|
166
|
public <TERM extends DefinedTermBase> List<TERM> listByTermClass(Class<TERM> clazz, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
|
167
|
}
|