Project

General

Profile

« Previous | Next » 

Revision 2d09ccf7

Added by Andreas Müller over 4 years ago

add more specific return type to CommonService.getSourcedObjectByIdInSource

View differences:

cdmlib-persistence/src/main/java/eu/etaxonomy/cdm/persistence/dao/reference/IOriginalSourceDao.java
1 1
/**
2 2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
3
* European Distributed Institute of Taxonomy
4 4
* http://www.e-taxonomy.eu
5
* 
5
*
6 6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
* See LICENSE.TXT at the top of this package for the full license terms.
8 8
*/
9 9

  
10 10
package eu.etaxonomy.cdm.persistence.dao.reference;
11 11

  
12
import eu.etaxonomy.cdm.model.common.IdentifiableEntity;
13
import eu.etaxonomy.cdm.model.reference.ISourceable;
14
import eu.etaxonomy.cdm.model.reference.OriginalSourceBase;
15
import eu.etaxonomy.cdm.persistence.dao.common.ICdmEntityDao;
16

  
17 12
import java.util.List;
18 13
import java.util.Map;
19 14
import java.util.Set;
20 15

  
16
import eu.etaxonomy.cdm.model.reference.ISourceable;
17
import eu.etaxonomy.cdm.model.reference.OriginalSourceBase;
18
import eu.etaxonomy.cdm.persistence.dao.common.ICdmEntityDao;
19

  
21 20

  
22 21
public interface IOriginalSourceDao extends ICdmEntityDao<OriginalSourceBase>{
23 22

  
24 23

  
25 24
	/**
26
	 * Returns a map of identifiable entities of class <code>clazz</code> which have an original source of 
25
	 * Returns a map of identifiable entities of class <code>clazz</code> which have an original source of
27 26
	 * with namespace <code>idNamespace</code> and with an idInSource in <code>idInSourceList</code> <BR>
28 27
	 * The key of the map is the idInSource. If there are multiple objects that have the same id an arbitrary one is chosen.
29 28
	 * @param clazz
......
32 31
	 * @return
33 32
	 */
34 33
	public Map<String, ISourceable> findOriginalSourcesByIdInSource(Class clazz, Set<String> idInSourceSet, String idNamespace);
35
	
34

  
36 35

  
37 36
	/**
38 37
	 * Returns a list of identifiable entities according to their class, idInSource and idNamespace
......
41 40
	 * @param idNamespace
42 41
	 * @return
43 42
	 */
44
	public List<IdentifiableEntity> findOriginalSourceByIdInSource(Class clazz, String idInSource, String idNamespace);
43
	public <S extends ISourceable> List<S> findOriginalSourceByIdInSource(Class<S> clazz, String idInSource, String idNamespace);
45 44

  
46 45
	/**
47 46
	 * Returns the first OriginalSource with according idInSource and idNamespace
......
51 50
	 */
52 51
	public List<OriginalSourceBase> findOriginalSourceByIdInSource(String idInSource, String idNamespace);
53 52

  
54
	
53

  
55 54
}

Also available in: Unified diff