Clean warnings in cdmlib-persistence
[cdmlib.git] / cdmlib-persistence / src / main / java / eu / etaxonomy / cdm / persistence / dao / common / ICdmEntityDao.java
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.Collection;
13 import java.util.List;
14 import java.util.Map;
15 import java.util.UUID;
16
17 import org.springframework.dao.DataAccessException;
18
19 import eu.etaxonomy.cdm.model.common.CdmBase;
20
21 /**
22 * an data access interface that all data access classes implement
23 * @author m.doering
24 * @version 1.0
25 * @created 02-Nov-2007 19:36:10
26 */
27 public interface ICdmEntityDao<T extends CdmBase> {
28
29 /**
30 * @param transientObject
31 * @return
32 * @throws DataAccessException
33 */
34 public UUID saveOrUpdate(T transientObject) throws DataAccessException;
35
36 //public UUID saveOrUpdateAll(Collection<T> transientObjects) throws DataAccessException;
37
38 /**
39 * @param newOrManagedObject
40 * @return
41 * @throws DataAccessException
42 */
43 public UUID save(T newOrManagedObject) throws DataAccessException;
44
45 public Map<UUID, T> saveAll(Collection<T> cdmObjCollection) throws DataAccessException;
46
47 /**
48 * @param transientObject
49 * @return
50 * @throws DataAccessException
51 */
52 public UUID update(T transientObject) throws DataAccessException;
53
54 /**
55 * @param persistentObject
56 * @return
57 * @throws DataAccessException
58 */
59 public UUID delete(T persistentObject) throws DataAccessException;
60
61 /**
62 * Returns a sublist of CdmBase instances stored in the database.
63 * A maximum of 'limit' objects are returned, starting at object with index 'start'.
64 * @param limit
65 * @param start
66 * @return
67 * @throws DataAccessException
68 */
69 public List<T> list(int limit, int start) throws DataAccessException;
70
71 public List<T> rows(String tableName, int limit, int start) throws DataAccessException;
72
73 /**
74 * @param id
75 * @return
76 * @throws DataAccessException
77 */
78 public T findById(int id) throws DataAccessException;
79
80 /**
81 * @param Uuid
82 * @return
83 * @throws DataAccessException
84 */
85 public T findByUuid(UUID Uuid) throws DataAccessException;
86
87 /**
88 * @param uuid
89 * @return
90 * @throws DataAccessException
91 */
92 public Boolean exists(UUID uuid) throws DataAccessException;
93
94 public int count();
95
96 public int count(Class clazz);
97
98 /**
99 *
100 */
101 public void flush();
102
103
104
105 }