eu.etaxonomy.cdm.persistence.dao.hibernate.common
Class CdmGenericDaoImpl

java.lang.Object
  extended by eu.etaxonomy.cdm.persistence.dao.hibernate.common.DaoBase
      extended by eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase<CdmBase>
          extended by eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmGenericDaoImpl
All Implemented Interfaces:
ICdmEntityDao<CdmBase>, ICdmGenericDao

@Repository
public class CdmGenericDaoImpl
extends CdmEntityDaoBase<CdmBase>
implements ICdmGenericDao


Field Summary
 
Fields inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase
defaultBeanInitializer, flushAfterNo, type, version
 
Constructor Summary
CdmGenericDaoImpl()
           
 
Method Summary
<T extends CdmBase>
T
find(Class<T> clazz, int id)
           
<T extends IMatchable>
List<T>
findMatching(T objectToMatch, IMatchStrategy matchStrategy)
          Returns a List of matching persistent objects according to the match strategy
<T extends IMatchable>
List<T>
findMatchingNullSafe(T objectToMatch, IMatchStrategy matchStrategy)
           
 Set<Class<? extends CdmBase>> getAllCdmClasses(boolean includeAbstractClasses)
          Returns all CDM classes.
 List<CdmBase> getCdmBasesByFieldAndClass(Class clazz, String propertyName, CdmBase referencedCdmBase)
          Returns a CdmBase object of class clazz that has a property with name propertyName that references the CdmBase object referencedCdmBase.
 List<CdmBase> getCdmBasesWithItemInCollection(Class itemClass, Class clazz, String propertyName, CdmBase item)
          Returns ...
 List<CdmBase> getHqlResult(String hqlQuery)
          Returns the result of an hql query TODO implement parameters
 List<CdmMetaData> getMetaData()
           
 Set<CdmBase> getReferencingObjects(CdmBase referencedCdmBase)
          Returns all CdmBase objects that reference the referencedCdmBase.
<T extends CdmBase>
void
merge(T cdmBase1, T cdmBase2, IMergeStrategy mergeStrategy)
          Merges cdmBase2 into cdmBase2 and rearranges all reference to cdmBase2 by letting them point to cdmBase1.
 void saveMetaData(CdmMetaData cdmMetaData)
           
 void test()
           
 
Methods inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase
addCriteria, addExample, addGroups, addOrder, clear, count, count, count, countByParam, countGroups, delete, exists, findById, findByParam, findByUuid, getSession, getType, group, list, list, list, list, list, list, list, list, listByIds, load, load, load, lock, merge, refresh, refresh, replace, rows, save, saveAll, saveCdmObj, saveOrUpdate, saveOrUpdateAll, setDefaultBeanInitializer, setPagingParameter, setPagingParameter, update
 
Methods inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.DaoBase
addOrder, flush, getSessionFactory, setSessionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.etaxonomy.cdm.persistence.dao.common.ICdmGenericDao
delete, save, saveOrUpdate, update
 
Methods inherited from interface eu.etaxonomy.cdm.persistence.dao.common.ICdmEntityDao
flush
 

Constructor Detail

CdmGenericDaoImpl

public CdmGenericDaoImpl()
Method Detail

getCdmBasesByFieldAndClass

public List<CdmBase> getCdmBasesByFieldAndClass(Class clazz,
                                                String propertyName,
                                                CdmBase referencedCdmBase)
Description copied from interface: ICdmGenericDao
Returns a CdmBase object of class clazz that has a property with name propertyName that references the CdmBase object referencedCdmBase.

Specified by:
getCdmBasesByFieldAndClass in interface ICdmGenericDao
Returns:

getCdmBasesWithItemInCollection

public List<CdmBase> getCdmBasesWithItemInCollection(Class itemClass,
                                                     Class clazz,
                                                     String propertyName,
                                                     CdmBase item)
Description copied from interface: ICdmGenericDao
Returns ...

Specified by:
getCdmBasesWithItemInCollection in interface ICdmGenericDao
Returns:

getAllCdmClasses

public Set<Class<? extends CdmBase>> getAllCdmClasses(boolean includeAbstractClasses)
Description copied from interface: ICdmGenericDao
Returns all CDM classes. If includeAbstractClasses is false the abstract classes will not be in the resultset.

Specified by:
getAllCdmClasses in interface ICdmGenericDao
Returns:

getReferencingObjects

public Set<CdmBase> getReferencingObjects(CdmBase referencedCdmBase)
Description copied from interface: ICdmGenericDao
Returns all CdmBase objects that reference the referencedCdmBase. For example, if referencedCdmBase is an agent it may return all taxon names that have this person as an author but also all books, articles, etc. that have this person as an author

Specified by:
getReferencingObjects in interface ICdmGenericDao
Returns:

getHqlResult

public List<CdmBase> getHqlResult(String hqlQuery)
Description copied from interface: ICdmGenericDao
Returns the result of an hql query TODO implement parameters

Specified by:
getHqlResult in interface ICdmGenericDao
Returns:

merge

public <T extends CdmBase> void merge(T cdmBase1,
                                      T cdmBase2,
                                      IMergeStrategy mergeStrategy)
           throws MergeException
Description copied from interface: ICdmGenericDao
Merges cdmBase2 into cdmBase2 and rearranges all reference to cdmBase2 by letting them point to cdmBase1. If the merge strategy is not defined (null) the default merge strategy is taken instead.

Specified by:
merge in interface ICdmGenericDao
Throws:
MergeException

test

public void test()
Specified by:
test in interface ICdmGenericDao

find

public <T extends CdmBase> T find(Class<T> clazz,
                                  int id)
Specified by:
find in interface ICdmGenericDao

findMatching

public <T extends IMatchable> List<T> findMatching(T objectToMatch,
                                                   IMatchStrategy matchStrategy)
                                        throws MatchException
Description copied from interface: ICdmGenericDao
Returns a List of matching persistent objects according to the match strategy

Specified by:
findMatching in interface ICdmGenericDao
Returns:
Throws:
MatchException

findMatchingNullSafe

public <T extends IMatchable> List<T> findMatchingNullSafe(T objectToMatch,
                                                           IMatchStrategy matchStrategy)
                                                throws IllegalArgumentException,
                                                       IllegalAccessException,
                                                       MatchException
Throws:
IllegalArgumentException
IllegalAccessException
MatchException

saveMetaData

public void saveMetaData(CdmMetaData cdmMetaData)
Specified by:
saveMetaData in interface ICdmGenericDao

getMetaData

public List<CdmMetaData> getMetaData()
Specified by:
getMetaData in interface ICdmGenericDao


Copyright © 2007-2013 EDIT. All Rights Reserved.