com.atlassian.confluence.pages.persistence.dao.hibernate
Class HibernateAbstractPageDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate.support.HibernateDaoSupport
          extended by com.atlassian.hibernate.HibernateObjectDao
              extended by com.atlassian.confluence.pages.persistence.dao.hibernate.HibernateAbstractPageDao
All Implemented Interfaces:
ObjectDao, AbstractPageDao, org.springframework.beans.factory.InitializingBean

public class HibernateAbstractPageDao
extends HibernateObjectDao
implements AbstractPageDao


Field Summary
 
Fields inherited from class com.atlassian.hibernate.HibernateObjectDao
log
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
HibernateAbstractPageDao()
           
 
Method Summary
 AbstractPage getAbstractPageById(long id)
          Returns a Page or BlogPost depending on whether a page id or blog post id is specified.
 java.util.List<AbstractPage> getAbstractPageByIds(java.lang.Iterable<java.lang.Long> ids)
          Retrieves a list of AbstractPage for the list of id
protected  AbstractPage getByClassId(long id)
          Retrieve the object with a particular id from the database.
 int getCountOfLatestXhtmlContent(long endContentId)
          Count the number of AbstractPages that have an ID lower than the specified ID, excluding older versions.
 long getHighestCeoId()
          Get the highest content ID in the database, excluding older versions of content.
 java.util.List<ContentEntityObject> getOrderedXhtmlContentFromContentId(long startContentId, long endContentId, int maxRows)
          Gets the latest versions of AbstractPages between the given IDs limited by the specified number of rows.
 java.lang.Class getPersistentClass()
           
 java.util.List<ContentEntityObject> getPreviousVersionsOfPageWithTaskId(long pageId, long taskId, int maxRows)
          Get previous versions of a CEO that contain the given task ID sorted by versions in descending order.
 
Methods inherited from class com.atlassian.hibernate.HibernateObjectDao
findAll, findAllSorted, findAllSorted, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getCountResult, index, refresh, reIndex, remove, replicate, save, saveRaw, setIndexer, unIndex, uniqueResult, updateModificationData
 
Methods inherited from class org.springframework.orm.hibernate.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
 

Constructor Detail

HibernateAbstractPageDao

public HibernateAbstractPageDao()
Method Detail

getByClassId

protected AbstractPage getByClassId(long id)
Description copied from class: HibernateObjectDao
Retrieve the object with a particular id from the database. The object must be of the same class as the DAO's getPersistentClass() method returns.

Overrides:
getByClassId in class HibernateObjectDao
Parameters:
id - the id of the object to look up
Returns:
the corresponding object, or null if the object does not exist with the appropriate class and id.

getAbstractPageById

public AbstractPage getAbstractPageById(long id)
Returns a Page or BlogPost depending on whether a page id or blog post id is specified.

Specified by:
getAbstractPageById in interface AbstractPageDao
Returns:
an object that is either a Page or BlogPost (current subclasses of AbstractPage). Null if no result could be found.

getAbstractPageByIds

public java.util.List<AbstractPage> getAbstractPageByIds(java.lang.Iterable<java.lang.Long> ids)
Description copied from interface: AbstractPageDao
Retrieves a list of AbstractPage for the list of id

Specified by:
getAbstractPageByIds in interface AbstractPageDao

getOrderedXhtmlContentFromContentId

public java.util.List<ContentEntityObject> getOrderedXhtmlContentFromContentId(long startContentId,
                                                                               long endContentId,
                                                                               int maxRows)
Description copied from interface: AbstractPageDao
Gets the latest versions of AbstractPages between the given IDs limited by the specified number of rows. Sorted by IDs in ascending order.

Specified by:
getOrderedXhtmlContentFromContentId in interface AbstractPageDao
Parameters:
startContentId - The minimum ID
endContentId - The maximum ID
maxRows - The maximum number of rows to return
Returns:
A list of CEOs that match the criteria.

getHighestCeoId

public long getHighestCeoId()
Description copied from interface: AbstractPageDao
Get the highest content ID in the database, excluding older versions of content.

Specified by:
getHighestCeoId in interface AbstractPageDao
Returns:
The highest content ID

getPreviousVersionsOfPageWithTaskId

public java.util.List<ContentEntityObject> getPreviousVersionsOfPageWithTaskId(long pageId,
                                                                               long taskId,
                                                                               int maxRows)
Description copied from interface: AbstractPageDao
Get previous versions of a CEO that contain the given task ID sorted by versions in descending order.

Specified by:
getPreviousVersionsOfPageWithTaskId in interface AbstractPageDao
Parameters:
pageId - The ID of the latest version of the page
taskId - The task ID to look for in previous versions
maxRows - The maximum number of previous versions to return
Returns:
A maximum of maxRows previous versions of the page that contain the given taskId

getCountOfLatestXhtmlContent

public int getCountOfLatestXhtmlContent(long endContentId)
Description copied from interface: AbstractPageDao
Count the number of AbstractPages that have an ID lower than the specified ID, excluding older versions.

Specified by:
getCountOfLatestXhtmlContent in interface AbstractPageDao
Parameters:
endContentId - The maximum ID
Returns:
The number of AbstractPages that have IDs lower than the specified ID

getPersistentClass

public java.lang.Class getPersistentClass()
Specified by:
getPersistentClass in interface ObjectDao


Copyright © 2003-2014 Atlassian. All Rights Reserved.