org.riotfamily.riot.hibernate.dao
Class HqlDao

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.AbstractHqlDao
                  extended by org.riotfamily.riot.hibernate.dao.HqlDao
All Implemented Interfaces:
RiotDao, SortableDao, SwappableItemDao, InitializingBean
Direct Known Subclasses:
HibernateUserDao, HqlParentChildDao

public class HqlDao
extends AbstractHqlDao
implements SwappableItemDao

RiotDao implementation based on Hibernate.


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
HqlDao(org.hibernate.SessionFactory sessionFactory)
           
 
Method Summary
protected  String buildMaxPositionHql(Object parent)
          Builds a HQL query string to retrieve the maximal position property value
 Class<?> getEntityClass()
          Returns the class that is accessed by the DAO.
protected  String getOrderBy(ListParams params)
           
protected  String getSelect()
           
 String getWhere()
           
protected  boolean isPolymorph()
           
protected  boolean isSetPositionOnSave()
           
 void save(Object entity, Object parent)
          Saves the given entity.
 void setEntityClass(Class<?> entityClass)
           
 void setPolymorph(boolean polymorph)
           
protected  void setPositionIfNeeded(Object entity, Object parent)
           
 void setPositionProperty(String positionProperty)
           
 void setSelect(String select)
           
 void setSetPositionOnSave(boolean setPositionOnSave)
           
 void setWhere(String where)
           
 void swapEntity(Object item, Object parent, ListParams params, int swapWith)
           
 
Methods inherited from class org.riotfamily.riot.hibernate.dao.AbstractHqlDao
buildCountHql, buildHql, getFilterWhereClause, getFrom, getListSize, getSearchWhereClause, getWhereClause, isPrefixSearch, isSuffixSearch, listInternal, setFilterParameters, setQueryParameters
 
Methods inherited from class org.riotfamily.riot.hibernate.dao.AbstractHibernateRiotDao
delete, 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
delete, getListSize, getObjectId, list, load, merge, update
 

Constructor Detail

HqlDao

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

getEntityClass

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

Specified by:
getEntityClass in interface RiotDao

setEntityClass

public void setEntityClass(Class<?> entityClass)

isPolymorph

protected boolean isPolymorph()
Overrides:
isPolymorph in class AbstractHqlDao

setPolymorph

public void setPolymorph(boolean polymorph)

getSelect

protected String getSelect()
Overrides:
getSelect in class AbstractHqlDao

setSelect

public void setSelect(String select)

getWhere

public String getWhere()
Overrides:
getWhere in class AbstractHqlDao

setWhere

public void setWhere(String where)

setPositionProperty

public void setPositionProperty(String positionProperty)

setSetPositionOnSave

public void setSetPositionOnSave(boolean setPositionOnSave)

isSetPositionOnSave

protected boolean isSetPositionOnSave()

buildMaxPositionHql

protected String buildMaxPositionHql(Object parent)
Builds a HQL query string to retrieve the maximal position property value


setPositionIfNeeded

protected void setPositionIfNeeded(Object entity,
                                   Object parent)

getOrderBy

protected String getOrderBy(ListParams params)
Overrides:
getOrderBy in class AbstractHqlDao

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

swapEntity

public void swapEntity(Object item,
                       Object parent,
                       ListParams params,
                       int swapWith)
Specified by:
swapEntity in interface SwappableItemDao