org.riotfamily.riot.hibernate.dao
Class HqlCollectionDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.riotfamily.riot.hibernate.dao.AbstractHibernateRiotDao
              extended by org.riotfamily.riot.hibernate.dao.HqlCollectionDao
All Implemented Interfaces:
CutAndPasteEnabledDao, ParentChildDao, RiotDao, SortableDao, InitializingBean
Direct Known Subclasses:
HqlIndexedListDao, HqlSortedCollectionDao

public class HqlCollectionDao
extends AbstractHibernateRiotDao
implements SortableDao, ParentChildDao, CutAndPasteEnabledDao

RiotDao implementation that loads a bean and returns one of the bean's properties as (filtered) collection.


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
HqlCollectionDao(org.hibernate.SessionFactory sessionFactory)
           
 
Method Summary
 void addChild(Object entity, Object parent)
          Adds the entity to a new parent.
protected  void buildQueryString(StringBuffer hql, ListParams params)
           
 void delete(Object entity, Object parent)
          Deletes the given entity.
protected  Collection<Object> getCollection(Object parent)
           
 Class<?> getEntityClass()
          Returns the class that is accessed by the DAO.
 int getListSize(Object parent, ListParams params)
          Returns the total number of entities.
protected  String getOrderBy(ListParams params)
           
 Object getParent(Object entity)
           
protected  List<?> listInternal(Object parent, ListParams params)
           
 void removeChild(Object entity, Object parent)
          Removes the entity from the given parent.
 void save(Object entity, Object parent)
          Saves the given entity.
 void setCollectionProperty(String property)
           
 void setEntityClass(Class<?> entityClass)
           
 void setParentClass(Class<?> parentClass)
           
 void setParentProperty(String parentProperty)
           
 void setPolymorph(boolean polymorph)
           
 void setWhere(String string)
           
 
Methods inherited from class org.riotfamily.riot.hibernate.dao.AbstractHibernateRiotDao
getObjectId, list, load, merge, update
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.riotfamily.riot.dao.RiotDao
getObjectId, list, load, merge, update
 
Methods inherited from interface org.riotfamily.riot.dao.RiotDao
getObjectId, list, load, merge, update
 

Constructor Detail

HqlCollectionDao

public HqlCollectionDao(org.hibernate.SessionFactory sessionFactory)
Method Detail

setEntityClass

public void setEntityClass(Class<?> entityClass)

getEntityClass

public Class<?> getEntityClass()
Description copied from interface: RiotDao
Returns the class that is accessed by the DAO.

Specified by:
getEntityClass in interface RiotDao

setPolymorph

public void setPolymorph(boolean polymorph)

setWhere

public void setWhere(String string)

setParentClass

public void setParentClass(Class<?> parentClass)

setCollectionProperty

public void setCollectionProperty(String property)

setParentProperty

public void setParentProperty(String parentProperty)

getParent

public Object getParent(Object entity)
Specified by:
getParent in interface ParentChildDao

save

public void save(Object entity,
                 Object parent)
Description copied from interface: RiotDao
Saves the given entity.

Specified by:
save in interface RiotDao
Overrides:
save in class AbstractHibernateRiotDao

delete

public void delete(Object entity,
                   Object parent)
Description copied from interface: RiotDao
Deletes the given entity.

Specified by:
delete in interface RiotDao
Overrides:
delete in class AbstractHibernateRiotDao

getCollection

protected Collection<Object> getCollection(Object parent)

buildQueryString

protected void buildQueryString(StringBuffer hql,
                                ListParams params)

listInternal

protected List<?> listInternal(Object parent,
                               ListParams params)
Overrides:
listInternal in class AbstractHibernateRiotDao

getListSize

public int getListSize(Object parent,
                       ListParams params)
Description copied from interface: RiotDao
Returns the total number of entities.

Specified by:
getListSize in interface RiotDao
Overrides:
getListSize in class AbstractHibernateRiotDao

getOrderBy

protected String getOrderBy(ListParams params)

addChild

public void addChild(Object entity,
                     Object parent)
Description copied from interface: CutAndPasteEnabledDao
Adds the entity to a new parent.

Specified by:
addChild in interface CutAndPasteEnabledDao

removeChild

public void removeChild(Object entity,
                        Object parent)
Description copied from interface: CutAndPasteEnabledDao
Removes the entity from the given parent.

Specified by:
removeChild in interface CutAndPasteEnabledDao