org.riotfamily.riot.dao
Interface RiotDao

All Known Subinterfaces:
CopyAndPasteEnabledDao, CutAndPasteEnabledDao, ParentChildDao, RiotUserDao, SwappableItemDao, TreeHintDao
All Known Implementing Classes:
AbstractHibernateRiotDao, AbstractHqlDao, HibernateUserDao, HqlCollectionDao, HqlDao, HqlIndexedListDao, HqlParentChildDao, HqlSortedCollectionDao, InMemoryRiotDao, PageRiotDao, RiotDaoAdapter, RiotUserDaoWrapper, SiteRiotDao, StaticRiotDao, StaticRiotUserDao

public interface RiotDao

Interface that provides access to an underlying data store.


Method Summary
 void delete(Object entity, Object parent)
          Deletes the given entity.
 Class<?> getEntityClass()
          Returns the class that is accessed by the DAO.
 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.
 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.
 

Method Detail

getEntityClass

Class<?> getEntityClass()
Returns the class that is accessed by the DAO.


getObjectId

String getObjectId(Object entity)
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.


load

Object load(String id)
            throws DataAccessException
Returns the entity with the given id.

Throws:
DataAccessException

merge

Object merge(Object entity)
             throws DataAccessException
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.

Throws:
DataAccessException

update

void update(Object entity)
            throws DataAccessException
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.

Throws:
DataAccessException

save

void save(Object entity,
          Object parent)
          throws DataAccessException
Saves the given entity.

Throws:
DataAccessException

delete

void delete(Object entity,
            Object parent)
            throws DataAccessException
Deletes the given entity.

Throws:
DataAccessException

list

Collection<?> list(Object parent,
                   ListParams params)
                   throws DataAccessException
Returns a list of entities.

Throws:
DataAccessException

getListSize

int getListSize(Object parent,
                ListParams params)
                throws DataAccessException
Returns the total number of entities.

Throws:
DataAccessException