org.riotfamily.pages.dao
Class HibernatePageDao

java.lang.Object
  extended by org.riotfamily.pages.dao.AbstractPageDao
      extended by org.riotfamily.pages.dao.HibernatePageDao
All Implemented Interfaces:
PageDao, InitializingBean

public class HibernatePageDao
extends AbstractPageDao

PageDao implementation that uses Hibernate.

Since:
6.5
Author:
Felix Gnass [fgnass at neteye dot de], Jan-Frederic Linde [jfl at neteye dot de]

Constructor Summary
HibernatePageDao()
           
 
Method Summary
protected  void clearAliases(Page page)
           
protected  void deleteAliases(Site site)
           
protected  void deleteObject(Object object)
           
 PageNode findNodeOfType(String pageType)
          Returns the PageNode with the given pageType, or null if no such node exists.
 Page findPage(Site site, String path)
          Returns the Page with the given site and path, or null if no such page exists.
 PageAlias findPageAlias(Site site, String path)
          Returns the PageAlias with the given site and path, or null if no such alias exists.
 Page findPageOfType(String pageType, Site site)
          Returns the Page with the given pageType and site, or null if no such page exists.
 List<Page> findPagesOfType(String pageType, Site site)
          Returns all pages with the given pageType and site, or an empty list if no page is found.
 Site findSiteByLocale(Locale locale)
           
 Site getDefaultSite()
          Returns the first site returned by listSites().
 PageNode getRootNode()
          Returns the root node.
 List<String> getWildcardPaths(Site site)
           
protected  void initDao()
           
 List<Site> listSites()
          Returns all sites.
protected  Object loadObject(Class<?> clazz, Serializable id)
           
 Page mergePage(Page page)
           
 Site mergeSite(Site site)
           
protected  void refreshIfDetached(Object object)
           
protected  void saveObject(Object object)
           
 void setSessionFactory(org.hibernate.SessionFactory sessionFactory)
           
 
Methods inherited from class org.riotfamily.pages.dao.AbstractPageDao
addTranslation, addTranslation, afterPropertiesSet, createAlias, createGoneAlias, deleteAlias, deletePage, deleteSite, discardPageProperties, findSite, findSiteWithProperty, getPageTypeHierarchy, loadPage, loadPageNode, loadSite, moveNode, publishPage, publishPageProperties, refreshPageIfDetached, refreshSiteIfDetached, saveNode, savePage, savePage, saveSite, setAutoCreatePages, setCacheService, setComponentDao, setPageTypeHierarchy, unpublishPage, updateNode, updatePage, updateSite
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HibernatePageDao

public HibernatePageDao()
Method Detail

setSessionFactory

public void setSessionFactory(org.hibernate.SessionFactory sessionFactory)

initDao

protected void initDao()
Overrides:
initDao in class AbstractPageDao

loadObject

protected Object loadObject(Class<?> clazz,
                            Serializable id)
Specified by:
loadObject in class AbstractPageDao

saveObject

protected void saveObject(Object object)
Specified by:
saveObject in class AbstractPageDao

refreshIfDetached

protected void refreshIfDetached(Object object)
Specified by:
refreshIfDetached in class AbstractPageDao

deleteObject

protected void deleteObject(Object object)
Specified by:
deleteObject in class AbstractPageDao

listSites

public List<Site> listSites()
Description copied from interface: PageDao
Returns all sites.


getDefaultSite

public Site getDefaultSite()
Description copied from interface: PageDao
Returns the first site returned by listSites().


getRootNode

public PageNode getRootNode()
Description copied from interface: PageDao
Returns the root node.


findSiteByLocale

public Site findSiteByLocale(Locale locale)

mergeSite

public Site mergeSite(Site site)

findPage

public Page findPage(Site site,
                     String path)
Description copied from interface: PageDao
Returns the Page with the given site and path, or null if no such page exists.


mergePage

public Page mergePage(Page page)

findNodeOfType

public PageNode findNodeOfType(String pageType)
Description copied from interface: PageDao
Returns the PageNode with the given pageType, or null if no such node exists.


findPageOfType

public Page findPageOfType(String pageType,
                           Site site)
Description copied from interface: PageDao
Returns the Page with the given pageType and site, or null if no such page exists.


findPagesOfType

public List<Page> findPagesOfType(String pageType,
                                  Site site)
Description copied from interface: PageDao
Returns all pages with the given pageType and site, or an empty list if no page is found.


getWildcardPaths

public List<String> getWildcardPaths(Site site)

findPageAlias

public PageAlias findPageAlias(Site site,
                               String path)
Description copied from interface: PageDao
Returns the PageAlias with the given site and path, or null if no such alias exists.


deleteAliases

protected void deleteAliases(Site site)
Specified by:
deleteAliases in class AbstractPageDao

clearAliases

protected void clearAliases(Page page)
Specified by:
clearAliases in class AbstractPageDao