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
.Enumeration
;
14 import java
.util
.List
;
15 import java
.util
.Locale
;
17 import java
.util
.UUID
;
19 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
20 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
21 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
22 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
23 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaType
;
24 import eu
.etaxonomy
.cdm
.model
.location
.Country
;
25 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
26 import eu
.etaxonomy
.cdm
.persistence
.dao
.IBeanInitializer
;
27 import eu
.etaxonomy
.cdm
.persistence
.query
.OrderHint
;
30 public interface IDefinedTermDao
extends IIdentifiableDao
<DefinedTermBase
>, ITitledDao
<DefinedTermBase
>{
33 * @param iso639 a two or three letter language code according to iso639-1 or iso639-2
34 * @return the Language or null
37 public Language
getLanguageByIso(String iso639
);
39 public List
<Language
> getLanguagesByIso(List
<String
> iso639List
);
41 public List
<Language
> getLanguagesByLocale(Enumeration
<Locale
> locales
);
43 public Country
getCountryByIso(String iso639
);
45 public <TYPE
extends DefinedTermBase
> List
<TYPE
> getDefinedTermByRepresentationText(String text
, Class
<TYPE
> clazz
);
47 public <TYPE
extends DefinedTermBase
> List
<TYPE
> getDefinedTermByRepresentationText(String text
, Class
<TYPE
> clazz
, Integer pageSize
,Integer pageNumber
);
49 public int countDefinedTermByRepresentationText(String text
, Class
<?
extends DefinedTermBase
> clazz
);
51 public <TYPE
extends DefinedTermBase
> List
<TYPE
> getDefinedTermByRepresentationAbbrev(String text
, Class
<TYPE
> clazz
, Integer pageSize
,Integer pageNumber
);
53 public int countDefinedTermByRepresentationAbbrev(String text
, Class
<?
extends DefinedTermBase
> clazz
);
57 * Returns a List of Media that represent a given DefinedTerm instance
59 * @param definedTerm the definedTerm represented by these media
60 * @param pageSize The maximum number of media returned (can be null for all related media)
61 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
62 * @return a List of media instances
64 public List
<Media
> getMedia(DefinedTermBase definedTerm
, Integer pageSize
, Integer pageNumber
);
67 * Returns a count of the Media that represent a given
68 * DefinedTermBase instance
70 * @param definedTerm the definedTerm represented by these media
71 * @return a count of Media entities
73 public int countMedia(DefinedTermBase definedTerm
);
76 * Returns a List of NamedArea instances (optionally filtered by type or level)
78 * @param level restrict the result set to named areas of a certain level (can be null)
79 * @param type restrict the result set to named areas of a certain type (can be null)
80 * @param pageSize The maximum number of namedAreas returned (can be null for all named areas)
81 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
82 * @return a List of named areas
84 public List
<NamedArea
> list(NamedAreaLevel level
, NamedAreaType type
, Integer pageSize
, Integer pageNumber
);
92 * @param propertyPaths
95 public List
<NamedArea
> list(NamedAreaLevel level
, NamedAreaType type
, Integer pageSize
, Integer pageNumber
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
99 * Returns a count of NamedArea instances (optionally filtered by type or level)
101 * @param level restrict the result set to named areas of a certain level (can be null)
102 * @param type restrict the result set to named areas of a certain type (can be null)
103 * @return a count of named areas
105 public int count(NamedAreaLevel level
, NamedAreaType type
);
108 * Return a list of terms which are specializations of a given definedTerm
110 * @param definedTerm The term which is a generalization of the terms returned
111 * @param pageSize The maximum number of terms returned (can be null for all specializations)
112 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
113 * @return a List of DefinedTerms
115 public <T
extends DefinedTermBase
> List
<T
> getGeneralizationOf(T definedTerm
, Integer pageSize
, Integer pageNumber
);
118 * Return a count of terms which are specializations of a given definedTerm
120 * @param definedTerm The term which is a generalization of the terms returned
121 * @return a count of DefinedTerms
123 public <T
extends DefinedTermBase
> int countGeneralizationOf(T definedTerm
);
126 * Return a List of distinct terms which include the terms supplied
128 * @param definedTerms the set of terms which are part of the terms of interest
129 * @param pageSize The maximum number of terms returned (can be null for all terms)
130 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
131 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
132 * @return a List of DefinedTerms
134 public <T
extends DefinedTermBase
> List
<T
> getPartOf(Set
<T
> definedTerms
, Integer pageSize
, Integer pageNumber
, List
<String
> propertyPaths
);
137 * Return a count of distinct terms which include the terms supplied
139 * @param definedTerms the set of terms which are part of the terms of interest
140 * @return a count of DefinedTerms
142 public <T
extends DefinedTermBase
> int countPartOf(Set
<T
> definedTerms
);
145 * Return a List of terms which are part of the terms supplied
147 * @param definedTerms the set of terms which include the terms of interest
148 * @param pageSize The maximum number of terms returned (can be null for all terms)
149 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
150 * @param propertyPaths properties to initialize - see {@link IBeanInitializer#initialize(Object, List)}
151 * @return a List of DefinedTerms
153 public <T
extends DefinedTermBase
> List
<T
> getIncludes(Set
<T
> definedTerms
, Integer pageSize
, Integer pageNumber
, List
<String
> propertyPaths
);
156 * Return a count of terms which are part of the terms supplied
158 * @param definedTerms the set of terms which include the terms of interest
159 * @return a count of DefinedTerms
161 public <T
extends DefinedTermBase
> int countIncludes(Set
<T
> definedTerms
);
163 public DefinedTermBase
findByUri(URI uri
);
165 public <TERM
extends DefinedTermBase
> List
<TERM
> listByTermClass(Class
<TERM
> clazz
, Integer limit
, Integer start
, List
<OrderHint
> orderHints
, List
<String
> propertyPaths
);
168 * Returns a term or a list of terms depending of the label/id used in its vocabulary.
176 public <TERM
extends DefinedTermBase
> List
<TERM
> getDefinedTermByIdInVocabulary(String idInVoc
, UUID vocUuid
, Class
<TERM
> clazz
, Integer pageSize
, Integer pageNumber
);