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
.Collection
;
13 import java
.util
.List
;
15 import java
.util
.UUID
;
17 import org
.hibernate
.Criteria
;
18 import org
.hibernate
.criterion
.Restrictions
;
19 import org
.springframework
.dao
.DataAccessException
;
20 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
23 * an data access interface that all data access classes implement
26 * @created 02-Nov-2007 19:36:10
28 public interface ICdmEntityDao
<T
extends CdmBase
> {
31 * @param transientObject
33 * @throws DataAccessException
35 public UUID
saveOrUpdate(T transientObject
) throws DataAccessException
;
37 //public UUID saveOrUpdateAll(Collection<T> transientObjects) throws DataAccessException;
40 * @param newOrManagedObject
42 * @throws DataAccessException
44 public UUID
save(T newOrManagedObject
) throws DataAccessException
;
46 public Map
<UUID
, T
> saveAll(Collection
<T
> cdmObjCollection
) throws DataAccessException
;
49 * @param transientObject
51 * @throws DataAccessException
53 public UUID
update(T transientObject
) throws DataAccessException
;
56 * @param persistentObject
58 * @throws DataAccessException
60 public UUID
delete(T persistentObject
) throws DataAccessException
;
63 * Returns a sublist of CdmBase instances stored in the database.
64 * A maximum of 'limit' objects are returned, starting at object with index 'start'.
68 * @throws DataAccessException
70 public List
<T
> list(int limit
, int start
) throws DataAccessException
;
75 * @throws DataAccessException
77 public T
findById(int id
) throws DataAccessException
;
82 * @throws DataAccessException
84 public T
findByUuid(UUID Uuid
) throws DataAccessException
;
89 * @throws DataAccessException
91 public Boolean
exists(UUID uuid
) throws DataAccessException
;
95 public int count(Class clazz
);