2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
10 package eu
.etaxonomy
.cdm
.persistence
.dao
.common
;
12 import java
.util
.List
;
13 import java
.util
.UUID
;
14 import org
.springframework
.dao
.DataAccessException
;
15 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
18 * an data access interface that all data access classes implement
21 * @created 02-Nov-2007 19:36:10
23 public interface ICdmEntityDao
<T
extends CdmBase
> {
26 * @param transientObject
28 * @throws DataAccessException
30 public UUID
saveOrUpdate(T transientObject
) throws DataAccessException
;
32 //public UUID saveOrUpdateAll(Collection<T> transientObjects) throws DataAccessException;
35 * @param newOrManagedObject
37 * @throws DataAccessException
39 public UUID
save(T newOrManagedObject
) throws DataAccessException
;
42 * @param transientObject
44 * @throws DataAccessException
46 public UUID
update(T transientObject
) throws DataAccessException
;
49 * @param persistentObject
51 * @throws DataAccessException
53 public UUID
delete(T persistentObject
) throws DataAccessException
;
56 * Returns a sublist of CdmBase instances stored in the database.
57 * A maximum of 'limit' objects are returned, starting at object with index 'start'.
61 * @throws DataAccessException
63 public List
<T
> list(int limit
, int start
) throws DataAccessException
;
68 * @throws DataAccessException
70 public T
findById(int id
) throws DataAccessException
;
75 * @throws DataAccessException
77 public T
findByUuid(UUID Uuid
) throws DataAccessException
;
82 * @throws DataAccessException
84 public Boolean
exists(UUID uuid
) throws DataAccessException
;
88 public int count(Class clazz
);