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
;
14 import java
.util
.UUID
;
16 import org
.springframework
.dao
.DataAccessException
;
18 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
20 public interface ICdmGenericDao
{
22 public UUID
saveOrUpdate(CdmBase transientObject
) throws DataAccessException
;
24 public UUID
save(CdmBase newOrManagedObject
) throws DataAccessException
;
26 public UUID
update(CdmBase transientObject
) throws DataAccessException
;
28 public UUID
delete(CdmBase persistentObject
) throws DataAccessException
;
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>.
38 public List
<CdmBase
> getCdmBasesByFieldAndClass(Class clazz
, String propertyName
, CdmBase referencedCdmBase
);
45 * @param referencedCdmBase
48 public List
<CdmBase
> getCdmBasesWithItemInCollection(Class itemClass
, Class clazz
, String propertyName
, CdmBase item
);
51 * Returns all CDM classes. If includeAbstractClasses is false the abstract classes
52 * will not be in the resultset.
53 * @param includeAbstractClasses
56 public Set
<Class
<?
extends CdmBase
>> getAllCdmClasses(boolean includeAbstractClasses
);
60 * Returns the result of an hql query
61 * TODO implement parameters
65 public List
getHqlResult(String hqlQuery
);