org.squashtest.csp.tm.internal.repository.hibernate
Class HibernateEntityDao<ENTITY_TYPE>

java.lang.Object
  extended by org.squashtest.csp.tm.internal.repository.hibernate.HibernateDao<ENTITY_TYPE>
      extended by org.squashtest.csp.tm.internal.repository.hibernate.HibernateEntityDao<ENTITY_TYPE>
All Implemented Interfaces:
EntityDao<ENTITY_TYPE>, GenericDao<ENTITY_TYPE>
Direct Known Subclasses:
HibernateAttachmentContentDao, HibernateAttachmentDao, HibernateAttachmentListDao, HibernateBugTrackerBindingDao, HibernateBugTrackerDao, HibernateCampaignDao, HibernateCampaignFolderDao, HibernateCampaignLibraryNodeDao, HibernateCampaignTestPlanItemDao, HibernateCustomCustomFieldBindingDao, HibernateCustomCustomFieldDao, HibernateExecutionDao, HibernateExecutionStepDao, HibernateIssueDao, HibernateItemTestPlanDao, HibernateIterationDao, HibernateLibraryDao, HibernateProjectDao, HibernateProjectFilterDao, HibernateRequirementDao, HibernateRequirementFolderDao, HibernateRequirementLibraryNodeDao, HibernateTestCaseDao, HibernateTestCaseFolderDao, HibernateTestCaseLibraryNodeDao, HibernateTestSuiteDao, HibernateUserDao, HibernateUsersGroupDao

public class HibernateEntityDao<ENTITY_TYPE>
extends HibernateDao<ENTITY_TYPE>
implements EntityDao<ENTITY_TYPE>


Field Summary
 
Fields inherited from class org.squashtest.csp.tm.internal.repository.hibernate.HibernateDao
entityType
 
Constructor Summary
HibernateEntityDao()
           
 
Method Summary
 List<ENTITY_TYPE> findAll()
           
 List<ENTITY_TYPE> findAllByIds(Collection<Long> ids)
           
 ENTITY_TYPE findById(long id)
           
protected  List<Long> findDescendantIds(List<Long> params, String sql)
           
protected  List<ENTITY_TYPE> findSorted(CollectionSorting filter, Class<ENTITY_TYPE> classe, String alias)
          Will find all Entities ordered according to the given params.
protected  List<ENTITY_TYPE> findSorted(org.squashtest.tm.core.foundation.collection.PagingAndSorting pagingAndSorting)
          Same as findSorted(PagingAndSorting, Class, String) using the current entity type and its class name as an alias.
protected  List<ENTITY_TYPE> findSorted(org.squashtest.tm.core.foundation.collection.PagingAndSorting filter, Class<ENTITY_TYPE> classe, String alias)
           
 String getIdPropertyName()
           
 
Methods inherited from class org.squashtest.csp.tm.internal.repository.hibernate.HibernateDao
clearFromCache, clearFromCache, currentSession, executeEntityNamedQuery, executeEntityNamedQuery, executeEntityNamedQuery, executeListNamedQuery, executeListNamedQuery, executeListNamedQuery, executeListNamedQuery, executeUpdateListQuery, flush, getEntity, persist, persist, persistEntity, remove, removeEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.squashtest.csp.tm.internal.repository.GenericDao
clearFromCache, clearFromCache, flush, persist, persist, remove
 

Constructor Detail

HibernateEntityDao

public HibernateEntityDao()
Method Detail

findById

public final ENTITY_TYPE findById(long id)
Specified by:
findById in interface EntityDao<ENTITY_TYPE>

findAll

public List<ENTITY_TYPE> findAll()
Specified by:
findAll in interface EntityDao<ENTITY_TYPE>
Returns:
a list of all entities found in the database with no restriction

findAllByIds

public List<ENTITY_TYPE> findAllByIds(Collection<Long> ids)
Specified by:
findAllByIds in interface EntityDao<ENTITY_TYPE>

getIdPropertyName

public String getIdPropertyName()

findDescendantIds

protected List<Long> findDescendantIds(List<Long> params,
                                       String sql)

findSorted

protected final List<ENTITY_TYPE> findSorted(CollectionSorting filter,
                                             Class<ENTITY_TYPE> classe,
                                             String alias)
Will find all Entities ordered according to the given params.

Parameters:
filter - the CollectionSorting that holds the order and paging params.
classe - the Class of the seeked entity
alias - a String representing the alias of the entity in the builed query.
Returns:

findSorted

protected final List<ENTITY_TYPE> findSorted(org.squashtest.tm.core.foundation.collection.PagingAndSorting filter,
                                             Class<ENTITY_TYPE> classe,
                                             String alias)

findSorted

protected final List<ENTITY_TYPE> findSorted(org.squashtest.tm.core.foundation.collection.PagingAndSorting pagingAndSorting)
Same as findSorted(PagingAndSorting, Class, String) using the current entity type and its class name as an alias.

Parameters:
pagingAndSorting -
Returns:


Copyright © 2010-2012 Henix, henix.fr. All Rights Reserved.