org.riotfamily.riot.hibernate.dao
Class AbstractHibernateRiotDao

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
All Implemented Interfaces:
RiotDao, InitializingBean
Direct Known Subclasses:
AbstractHqlDao, HqlCollectionDao

public abstract class AbstractHibernateRiotDao
extends HibernateDaoSupport
implements RiotDao


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
AbstractHibernateRiotDao(org.hibernate.SessionFactory sessionFactory)
           
 
Method Summary
 void delete(Object entity, Object parent)
          Deletes the given entity.
 int getListSize(Object parent, ListParams params)
          Returns the total number of entities.
 String getObjectId(Object entity)
          Returns the id of the given entity.
 Collection<?> list(Object parent, ListParams params)
          Returns a list of entities.
protected  List<?> listInternal(Object parent, ListParams params)
           
 Object load(String id)
          Returns the entity with the given id.
 Object merge(Object entity)
          Re-attaches the given entity.
 void save(Object entity, Object parent)
          Saves the given entity.
 void update(Object entity)
          Updates the given entity.
 
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
getEntityClass
 

Constructor Detail

AbstractHibernateRiotDao

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

getObjectId

public String getObjectId(Object entity)
Description copied from interface: RiotDao
Returns the id of the given entity. Implementors will most likely need to perform a type conversion in order to return a String representation. The returned String must be parseable by the load() method.

Specified by:
getObjectId in interface RiotDao

load

public Object load(String id)
            throws DataAccessException
Description copied from interface: RiotDao
Returns the entity with the given id.

Specified by:
load in interface RiotDao
Throws:
DataAccessException

getListSize

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

Specified by:
getListSize in interface RiotDao
Throws:
DataAccessException

list

public final Collection<?> list(Object parent,
                                ListParams params)
Description copied from interface: RiotDao
Returns a list of entities.

Specified by:
list in interface RiotDao

listInternal

protected List<?> listInternal(Object parent,
                               ListParams params)
                        throws DataAccessException
Throws:
DataAccessException

save

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

Specified by:
save in interface RiotDao
Throws:
DataAccessException

merge

public Object merge(Object entity)
             throws DataAccessException
Description copied from interface: RiotDao
Re-attaches the given entity. This method is invoked before an object that has been loaded in a previous request is modified. Implementors can use this method to perform modification checks or to re-attach the object to a persistence context.

Specified by:
merge in interface RiotDao
Throws:
DataAccessException

update

public void update(Object entity)
            throws DataAccessException
Description copied from interface: RiotDao
Updates the given entity. This method is invoked after an object has been modified. Session-based implementations (like Hibernate or JPA) will usually do nothing in this method, as changes are automatically written to the database when an object has been modified within a transaction.

Specified by:
update in interface RiotDao
Throws:
DataAccessException

delete

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

Specified by:
delete in interface RiotDao
Throws:
DataAccessException