Project

General

Profile

Download (5.43 KB) Statistics
| Branch: | Tag: | Revision:
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.location.NamedArea;
20
import eu.etaxonomy.cdm.model.location.NamedAreaLevel;
21
import eu.etaxonomy.cdm.model.location.NamedAreaType;
22
import eu.etaxonomy.cdm.model.location.WaterbodyOrCountry;
23
import eu.etaxonomy.cdm.model.media.Media;
24

    
25

    
26
public interface IDefinedTermDao extends IVersionableDao<DefinedTermBase>, ITitledDao<DefinedTermBase>{
27
	
28
	/**
29
	 * @param iso639 a two or three letter language code according to iso639-1 or iso639-2
30
	 * @return the Language or null
31
	 */
32
	//TODO refactor typo:
33
	public Language getLanguageByIso(String iso639);
34
	
35
	public List<Language> getLanguagesByIso(List<String> iso639List);
36
	
37
	public List<Language> getLanguagesByLocale(Enumeration<Locale> locales);
38
	
39
	public WaterbodyOrCountry getCountryByIso(String iso639);
40
	
41
	public <TYPE extends DefinedTermBase> List<TYPE> getDefinedTermByRepresentationText(String text, Class<TYPE> clazz );
42
	
43
    /**
44
     * Returns a List of Media that represent a given DefinedTerm instance
45
     * 
46
	 * @param definedTerm the definedTerm represented by these media
47
	 * @param pageSize The maximum number of media returned (can be null for all related media)
48
	 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
49
     * @return a List of media instances
50
     */
51
	public List<Media> getMedia(DefinedTermBase definedTerm, Integer pageSize, Integer pageNumber);
52
	
53
	/**
54
	 * Returns a count of the Media that represent a given 
55
	 * DefinedTermBase instance
56
	 * 
57
	 * @param definedTerm the definedTerm represented by these media
58
	 * @return a count of Media entities
59
	 */
60
	public int countMedia(DefinedTermBase definedTerm);
61
	
62
	/**
63
	 * Returns a List of NamedArea instances (optionally filtered by type or level)
64
	 * 
65
	 * @param level restrict the result set to named areas of a certain level (can be null)
66
	 * @param type restrict the result set to named areas of a certain type (can be null)
67
	 * @param pageSize The maximum number of namedAreas returned (can be null for all named areas)
68
	 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
69
	 * @return a List of named areas
70
	 */
71
	public List<NamedArea> list(NamedAreaLevel level, NamedAreaType type, Integer pageSize, Integer pageNumber);
72
	
73
	/**
74
	 * Returns a count of NamedArea instances (optionally filtered by type or level)
75
	 * 
76
	 * @param level restrict the result set to named areas of a certain level (can be null)
77
	 * @param type restrict the result set to named areas of a certain type (can be null)
78
	 * @return a count of named areas
79
	 */
80
	public int count(NamedAreaLevel level, NamedAreaType type);
81
	
82
	/**
83
	 * Return a list of terms which are specializations of a given definedTerm
84
	 * 
85
	 * @param definedTerm The term which is a generalization of the terms returned
86
	 * @param pageSize The maximum number of terms returned (can be null for all specializations)
87
	 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
88
	 * @return a List of DefinedTerms
89
	 */
90
	public <T extends DefinedTermBase> List<T> getGeneralizationOf(T definedTerm, Integer pageSize, Integer pageNumber);
91
	
92
	/**
93
	 * Return a count of terms which are specializations of a given definedTerm
94
	 * 
95
	 * @param definedTerm The term which is a generalization of the terms returned
96
	 * @return a count of DefinedTerms
97
	 */
98
	public <T extends DefinedTermBase> int countGeneralizationOf(T definedTerm);
99
	
100
	/**
101
	 * Return a List of distinct terms which include the terms supplied
102
	 * 
103
	 * @param definedTerms the set of terms which are part of the terms of interest 
104
	 * @param pageSize The maximum number of terms returned (can be null for all terms)
105
	 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
106
	 * @return a List of DefinedTerms
107
	 */
108
	public <T extends DefinedTermBase> List<T> getPartOf(Set<T> definedTerms, Integer pageSize, Integer pageNumber);
109
	
110
	/**
111
	 * Return a count of distinct terms which include the terms supplied
112
	 * 
113
	 * @param definedTerms the set of terms which are part of the terms of interest 
114
	 * @return a count of DefinedTerms
115
	 */
116
	public <T extends DefinedTermBase> int countPartOf(Set<T> definedTerms);
117
	
118
	/**
119
	 * Return a List of terms which are part of the terms supplied
120
	 * 
121
	 * @param definedTerms the set of terms which include the terms of interest 
122
	 * @param pageSize The maximum number of terms returned (can be null for all terms)
123
	 * @param pageNumber The offset (in pageSize chunks) from the start of the result set (0 - based)
124
	 * @return a List of DefinedTerms
125
	 */
126
	public <T extends DefinedTermBase> List<T> getIncludes(Set<T> definedTerms, Integer pageSize, Integer pageNumber);
127
	
128
	/**
129
	 * Return a count of terms which are part of the terms supplied
130
	 * 
131
	 * @param definedTerms the set of terms which include the terms of interest 
132
	 * @return a count of DefinedTerms
133
	 */
134
	public <T extends DefinedTermBase> int countIncludes(Set<T> definedTerms);
135

    
136
	public DefinedTermBase findByUri(String uri);
137
}
(6-6/21)