org.riotfamily.pages.riot.dao
Class PageRiotDao

java.lang.Object
  extended by org.riotfamily.pages.riot.dao.PageRiotDao
All Implemented Interfaces:
CutAndPasteEnabledDao, ParentChildDao, RiotDao, SwappableItemDao, TreeHintDao, InitializingBean

public class PageRiotDao
extends Object
implements ParentChildDao, TreeHintDao, SwappableItemDao, CutAndPasteEnabledDao, InitializingBean

Since:
6.5
Author:
Felix Gnass [fgnass at neteye dot de]

Constructor Summary
PageRiotDao()
           
 
Method Summary
 void addChild(Object entity, Object parent)
          Adds the entity to a new parent.
 void afterPropertiesSet()
           
 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.
 Object getParent(Object entity)
           
 boolean hasChildren(Object parent, Object root, ListParams params)
           
 Collection<Page> 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 removeChild(Object entity, Object parent)
          Removes the entity from the given parent.
 void save(Object entity, Object parent)
          Saves the given entity.
 void setPageDao(PageDao pageDao)
           
 void swapEntity(Object entity, Object parent, ListParams params, int swapWith)
           
 void update(Object entity)
          Updates the given entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageRiotDao

public PageRiotDao()
Method Detail

setPageDao

public void setPageDao(PageDao pageDao)

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

getParent

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

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

getEntityClass

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

Specified by:
getEntityClass in interface RiotDao

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

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

list

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

Specified by:
list in interface RiotDao
Throws:
DataAccessException

hasChildren

public boolean hasChildren(Object parent,
                           Object root,
                           ListParams params)
Specified by:
hasChildren in interface TreeHintDao

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

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

swapEntity

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

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