(no commit message)
[cdmlib.git] / cdmlibrary / src / main / java / eu / etaxonomy / cdm / persistence / dao / IDao.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;
11
12
13 import java.io.Serializable;
14 import java.util.List;
15
16 import org.apache.log4j.Logger;
17 import org.springframework.dao.DataAccessException;
18 import org.springframework.orm.hibernate3.HibernateTemplate;
19
20
21 import eu.etaxonomy.cdm.model.common.CdmBase;
22 import eu.etaxonomy.cdm.model.common.Enumeration;
23
24 /**
25 * an data access interface that all data access classes implement
26 * @author m.doering
27 * @version 1.0
28 * @created 02-Nov-2007 19:36:10
29 */
30 public interface IDao<T extends CdmBase> {
31 public String saveOrUpdate(T transientObject) throws DataAccessException;
32
33 /* (non-Javadoc)
34 * @see eu.etaxonomy.cdm.persistence.dao.IDAO#save(java.lang.Object)
35 */
36 public String save(T newOrManagedObject) throws DataAccessException;
37
38 /* (non-Javadoc)
39 * @see eu.etaxonomy.cdm.persistence.dao.IDAO#update(java.lang.Object)
40 */
41 public String update(T transientObject) throws DataAccessException;
42
43 /* (non-Javadoc)
44 * @see eu.etaxonomy.cdm.persistence.dao.IDAO#delete(java.lang.Object)
45 */
46 public String delete(T persistentObject) throws DataAccessException;
47
48 /* (non-Javadoc)
49 * @see eu.etaxonomy.cdm.persistence.dao.IDAO#findById(java.io.Serializable)
50 */
51 public T findById(int id) throws DataAccessException;
52
53 public T findByUuid(String Uuid) throws DataAccessException;
54
55 public Boolean exists(String uuid);
56
57 public List<T> find(String queryString);
58
59 public List<CdmBase> executeHsql(String hsql);
60
61 public List<T> list(int limit, int start);
62
63 }