findByUuid for sets of uuids
[cdmlib.git] / cdmlib-persistence / src / main / java / eu / etaxonomy / cdm / persistence / dao / common / ICdmGenericDao.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.List;
13 import java.util.Set;
14 import java.util.UUID;
15
16 import org.springframework.dao.DataAccessException;
17
18 import eu.etaxonomy.cdm.model.common.CdmBase;
19
20 public interface ICdmGenericDao {
21
22 public UUID saveOrUpdate(CdmBase transientObject) throws DataAccessException;
23
24 public UUID save(CdmBase newOrManagedObject) throws DataAccessException;
25
26 public UUID update(CdmBase transientObject) throws DataAccessException;
27
28 public UUID delete(CdmBase persistentObject) throws DataAccessException;
29
30 /**
31 * Returns a CdmBase object of class <code>clazz</code> that has a property with name
32 * <code>propertyName</code> that references the CdmBase object <code>referencedCdmBase</code>.
33 * @param clazz
34 * @param propertyName
35 * @param value
36 * @return
37 */
38 public List<CdmBase> getCdmBasesByFieldAndClass(Class clazz, String propertyName, CdmBase referencedCdmBase);
39
40 /**
41 * Returns ...
42 * @param thisClass
43 * @param otherClazz
44 * @param propertyName
45 * @param referencedCdmBase
46 * @return
47 */
48 public List<CdmBase> getCdmBasesWithItemInCollection(Class itemClass, Class clazz, String propertyName, CdmBase item);
49
50 /**
51 * Returns all CDM classes. If includeAbstractClasses is false the abstract classes
52 * will not be in the resultset.
53 * @param includeAbstractClasses
54 * @return
55 */
56 public Set<Class<? extends CdmBase>> getAllCdmClasses(boolean includeAbstractClasses);
57
58
59 /**
60 * Returns the result of an hql query
61 * TODO implement parameters
62 * @param hqlQuery
63 * @return
64 */
65 public List getHqlResult(String hqlQuery);
66 }