Project

General

Profile

Download (2.26 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

    
13
import java.io.Serializable;
14
import java.util.Collection;
15
import java.util.List;
16
import java.util.UUID;
17

    
18
import org.apache.log4j.Logger;
19
import org.springframework.dao.DataAccessException;
20
import org.springframework.orm.hibernate3.HibernateTemplate;
21

    
22

    
23
import eu.etaxonomy.cdm.model.common.CdmBase;
24
import eu.etaxonomy.cdm.model.common.TermVocabulary;
25

    
26
/**
27
 * an data access interface that all data access classes implement
28
 * @author m.doering
29
 * @version 1.0
30
 * @created 02-Nov-2007 19:36:10
31
 */
32
public interface ICdmEntityDao<T extends CdmBase> {
33
	
34
	/**
35
	 * @param transientObject
36
	 * @return
37
	 * @throws DataAccessException
38
	 */
39
	public UUID saveOrUpdate(T transientObject) throws DataAccessException;
40

    
41
	//public UUID saveOrUpdateAll(Collection<T> transientObjects) throws DataAccessException;
42
	
43
	/**
44
	 * @param newOrManagedObject
45
	 * @return
46
	 * @throws DataAccessException
47
	 */
48
	public UUID save(T newOrManagedObject) throws DataAccessException;
49
	
50
	/**
51
	 * @param transientObject
52
	 * @return
53
	 * @throws DataAccessException
54
	 */
55
	public UUID update(T transientObject) throws DataAccessException;
56
	
57
	/**
58
	 * @param persistentObject
59
	 * @return
60
	 * @throws DataAccessException
61
	 */
62
	public UUID delete(T persistentObject) throws DataAccessException;
63
	
64
	/**
65
	 * Returns a sublist of CdmBase instances stored in the database.
66
	 * A maximum of 'limit' objects are returned, starting at object with index 'start'.
67
	 * @param limit
68
	 * @param start
69
	 * @return
70
	 * @throws DataAccessException
71
	 */
72
	public List<T> list(int limit, int start) throws DataAccessException;
73

    
74
	/**
75
	 * @param id
76
	 * @return
77
	 * @throws DataAccessException
78
	 */
79
	public T findById(int id) throws DataAccessException;
80

    
81
	/**
82
	 * @param Uuid
83
	 * @return
84
	 * @throws DataAccessException
85
	 */
86
	public T findByUuid(UUID Uuid) throws DataAccessException;
87
	
88
	/**
89
	 * @param uuid
90
	 * @return
91
	 * @throws DataAccessException
92
	 */
93
	public Boolean exists(UUID uuid) throws DataAccessException;
94
	
95
	/**
96
	 * 
97
	 */
98
	public void flush();
99
	
100
}
(2-2/7)