(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 import eu.etaxonomy.cdm.model.Description;
21 import eu.etaxonomy.cdm.model.common.Enumeration;
22
23 /**
24 * an data access interface that all data access classes implement
25 * @author m.doering
26 * @version 1.0
27 * @created 02-Nov-2007 19:36:10
28 */
29 public interface IDao<T, ID extends Serializable> {
30 public void saveOrUpdate(T transientObject) throws DataAccessException;
31
32 /* (non-Javadoc)
33 * @see eu.etaxonomy.cdm.persistence.dao.IDAO#save(java.lang.Object)
34 */
35 public Serializable save(T newInstance) throws DataAccessException;
36
37 /* (non-Javadoc)
38 * @see eu.etaxonomy.cdm.persistence.dao.IDAO#update(java.lang.Object)
39 */
40 public void update(T transientObject) throws DataAccessException;
41
42 /* (non-Javadoc)
43 * @see eu.etaxonomy.cdm.persistence.dao.IDAO#delete(java.lang.Object)
44 */
45 public void delete(T persistentObject) throws DataAccessException;
46
47 /* (non-Javadoc)
48 * @see eu.etaxonomy.cdm.persistence.dao.IDAO#findById(java.io.Serializable)
49 */
50 public T findById(ID id) throws DataAccessException;
51
52 //********************************************//
53
54
55 public List<T> find(String queryString);
56
57 public Boolean exists(ID id);
58
59 public List<T> list(Integer limit);
60
61 }