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
;
12 import java
.util
.Enumeration
;
13 import java
.util
.List
;
14 import java
.util
.Locale
;
17 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
18 import eu
.etaxonomy
.cdm
.model
.common
.Language
;
19 import eu
.etaxonomy
.cdm
.model
.common
.Representation
;
20 import eu
.etaxonomy
.cdm
.model
.location
.NamedArea
;
21 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaLevel
;
22 import eu
.etaxonomy
.cdm
.model
.location
.NamedAreaType
;
23 import eu
.etaxonomy
.cdm
.model
.location
.WaterbodyOrCountry
;
24 import eu
.etaxonomy
.cdm
.model
.media
.Media
;
27 public interface IDefinedTermDao
extends ICdmEntityDao
<DefinedTermBase
>, ITitledDao
<DefinedTermBase
>{
30 * @param iso639 a two or three letter language code according to iso639-1 or iso639-2
31 * @return the Language or null
34 public Language
getLanguageByIso(String iso639
);
36 public List
<Language
> getLanguagesByIso(List
<String
> iso639List
);
38 public List
<Language
> getLanguagesByLocale(Enumeration
<Locale
> locales
);
40 public WaterbodyOrCountry
getCountryByIso(String iso639
);
42 public <TYPE
extends DefinedTermBase
> List
<TYPE
> getDefinedTermByRepresentationText(String text
, Class
<TYPE
> clazz
);
45 * Returns a List of Media that represent a given DefinedTerm instance
47 * @param definedTerm the definedTerm represented by these media
48 * @param pageSize The maximum number of media returned (can be null for all related media)
49 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
50 * @return a List of media instances
52 public List
<Media
> getMedia(DefinedTermBase definedTerm
, Integer pageSize
, Integer pageNumber
);
55 * Returns a count of the Media that represent a given
56 * DefinedTermBase instance
58 * @param definedTerm the definedTerm represented by these media
59 * @return a count of Media entities
61 public int countMedia(DefinedTermBase definedTerm
);
64 * Returns a List of NamedArea instances (optionally filtered by type or level)
66 * @param level restrict the result set to named areas of a certain level (can be null)
67 * @param type restrict the result set to named areas of a certain type (can be null)
68 * @param pageSize The maximum number of namedAreas returned (can be null for all named areas)
69 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
70 * @return a List of named areas
72 public List
<NamedArea
> list(NamedAreaLevel level
, NamedAreaType type
, Integer pageSize
, Integer pageNumber
);
75 * Returns a count of NamedArea instances (optionally filtered by type or level)
77 * @param level restrict the result set to named areas of a certain level (can be null)
78 * @param type restrict the result set to named areas of a certain type (can be null)
79 * @return a count of named areas
81 public int count(NamedAreaLevel level
, NamedAreaType type
);
84 * Return a list of terms which are specializations of a given definedTerm
86 * @param definedTerm The term which is a generalization of the terms returned
87 * @param pageSize The maximum number of terms returned (can be null for all specializations)
88 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
89 * @return a List of DefinedTerms
91 public <T
extends DefinedTermBase
> List
<T
> getGeneralizationOf(T definedTerm
, Integer pageSize
, Integer pageNumber
);
94 * Return a count of terms which are specializations of a given definedTerm
96 * @param definedTerm The term which is a generalization of the terms returned
97 * @return a count of DefinedTerms
99 public <T
extends DefinedTermBase
> int countGeneralizationOf(T definedTerm
);
102 * Return a List of distinct terms which include the terms supplied
104 * @param definedTerms the set of terms which are part of the terms of interest
105 * @param pageSize The maximum number of terms returned (can be null for all terms)
106 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
107 * @return a List of DefinedTerms
109 public <T
extends DefinedTermBase
> List
<T
> getPartOf(Set
<T
> definedTerms
, Integer pageSize
, Integer pageNumber
);
112 * Return a count of distinct terms which include the terms supplied
114 * @param definedTerms the set of terms which are part of the terms of interest
115 * @return a count of DefinedTerms
117 public <T
extends DefinedTermBase
> int countPartOf(Set
<T
> definedTerms
);
120 * Return a List of terms which are part of the terms supplied
122 * @param definedTerms the set of terms which include the terms of interest
123 * @param pageSize The maximum number of terms returned (can be null for all terms)
124 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
125 * @return a List of DefinedTerms
127 public <T
extends DefinedTermBase
> List
<T
> getIncludes(Set
<T
> definedTerms
, Integer pageSize
, Integer pageNumber
);
130 * Return a count of terms which are part of the terms supplied
132 * @param definedTerms the set of terms which include the terms of interest
133 * @return a count of DefinedTerms
135 public <T
extends DefinedTermBase
> int countIncludes(Set
<T
> definedTerms
);