public class HibernateBlogPostDao extends ConfluenceHibernateObjectDao implements BlogPostDao
HibernateObjectDao.Cacheability
cacheFactory, confluenceUserDao
NON_CACHEABLE
Constructor and Description |
---|
HibernateBlogPostDao() |
Modifier and Type | Method and Description |
---|---|
int |
countBlogsWithUnpublishedChanges()
Counts the number of published blog posts that have unpublished changes.
|
int |
countCurrentBlogs()
Counts the total number of current blog posts across all spaces
|
int |
countDraftBlogs()
Counts the number of blog posts that are drafts.
|
BlogPost |
getBlogPost(Space space,
String title,
Calendar day,
boolean eagerLoadComments)
Get the blog post by name and date.
|
BlogPost |
getBlogPost(String spaceKey,
String title,
Calendar day)
Deprecated.
|
BlogPost |
getBlogPost(String spaceKey,
String title,
Calendar day,
boolean eagerLoadComments)
Deprecated.
|
BlogPost |
getBlogPostByTitle(String spaceKey,
String title)
Get a blog post by name.
|
int |
getBlogPostCount()
Counts the total number of blog posts, for all spaces and posting dates.
|
long |
getBlogPostCount(String spaceKey,
Calendar date,
int period)
Get total number of blogPost.
|
List<Date> |
getBlogPostDates(Space space)
Returns a list of creation dates for all the blog posts in a space.
|
List<Date> |
getBlogPostDates(String spaceKey)
Deprecated.
|
List<Date> |
getBlogPostDates(String spaceKey,
Calendar date,
int period)
Returns a list of creation dates for all the blog posts in a space for a particular period.
|
List<BlogPost> |
getBlogPosts(Space space,
boolean currentOnly)
Return an iterator for the specified space.
|
List |
getBlogPosts(Space space,
Calendar date,
int period)
Get the blog posts in a space for a particular period.
|
List |
getBlogPosts(Space space,
Calendar date,
int period,
int startIndex,
int maxResultCount)
Get list of blogPost by Date.
|
List |
getBlogPosts(String spaceKey,
Calendar date,
int period)
Deprecated.
|
List |
getBlogPosts(String spaceKey,
Calendar date,
int period,
int startIndex,
int maxResultCount)
Deprecated.
|
List<BlogPost> |
getBlogPostsInTrash(String spaceKey,
String title)
Gets a blog post that is in the trash for a given space that matches the given title.
|
protected BlogPost |
getByClassId(long id)
Retrieve the object with a particular id from the database.
|
BlogPost |
getById(long id)
Get a blog post by id.
|
List<Long> |
getCurrentBlogPostIds()
Return a list of ids for all current blog posts.
|
BlogPost |
getFirstPostAfter(BlogPost post)
Used for finding the "previous" post to an existing post.
|
BlogPost |
getFirstPostAfter(String spaceKey,
Date creationDate)
Used for finding the "previous" post to an existing post
|
BlogPost |
getFirstPostBefore(BlogPost post)
Used for finding the "previous" post to an existing post.
|
BlogPost |
getFirstPostBefore(String spaceKey,
Date creationDate)
Used for finding the "previous" post to an existing post
|
BlogPost |
getMostRecentBlogPost(String spaceKey) |
Class |
getPersistentClass() |
List |
getRecentlyAddedBlogPosts(int maxPosts,
Date timeSince,
String spaceKey) |
List |
getRecentlyAddedBlogPosts(int maxCount,
String spaceKey)
Get list of recently created blog posts.
|
findAllSorted, findLatestVersionsCount, findLatestVersionsCount, findLatestVersionsIterator, findLatestVersionsIterator, findNamedQueryStringParams, findNamedQueryStringParams, save, setCacheFactory, setConfluenceUserDao, updateModificationData
applyTransactionTimeout, applyTransactionTimeout, checkDaoConfig, createHibernateTemplate, findAll, findAllSorted, findByClassIds, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getCountResult, getHibernateTemplate, getSession, getSessionFactory, index, refresh, reIndex, remove, replicate, save, saveRaw, setHibernateTemplate, setIndexer, setSessionFactory, unIndex, uniqueResult
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findLatestVersionsCount, findLatestVersionsIterator, save
findAll, findAllSorted, findAllSorted, findByClassIds, refresh, remove, replicate, save, saveRaw
public Class getPersistentClass()
getPersistentClass
in interface ObjectDao
public BlogPost getById(long id)
BlogPostDao
getById
in interface BlogPostDao
protected BlogPost getByClassId(long id)
HibernateObjectDao
getByClassId
in class HibernateObjectDao
id
- the id of the object to look uppublic BlogPost getBlogPostByTitle(String spaceKey, String title)
BlogPostDao
getBlogPostByTitle
in interface BlogPostDao
spaceKey
- the spacetitle
- the titlepublic List<BlogPost> getBlogPostsInTrash(String spaceKey, String title)
BlogPostDao
getBlogPostsInTrash
in interface BlogPostDao
spaceKey
- The space key (case-insensitive) in which to look for the blogtitle
- The title (case-insensitive) of the blog to look for@Deprecated @Nullable public BlogPost getBlogPost(String spaceKey, String title, Calendar day)
BlogPostDao
getBlogPost
in interface BlogPostDao
spaceKey
- the space to look for the post intitle
- the title of the post we are looking forday
- the DAY the post was created on. Any part of the calendar more specific than
a day will be ignored@Deprecated @Nullable public BlogPost getBlogPost(String spaceKey, String title, Calendar day, boolean eagerLoadComments)
BlogPostDao
getBlogPost
in interface BlogPostDao
spaceKey
- the space to look for the post intitle
- the title of the post we are looking forday
- the DAY the post was created on. Any part of the calendar more specific than
a day will be ignored@Nullable public BlogPost getBlogPost(@Nonnull Space space, @Nonnull String title, @Nonnull Calendar day, boolean eagerLoadComments)
BlogPostDao
getBlogPost
in interface BlogPostDao
space
- the space to look for the post intitle
- the title of the post we are looking forday
- the DAY the post was created on. Any part of the calendar more specific than
a day will be ignored@Deprecated public List getBlogPosts(String spaceKey, Calendar date, int period)
BlogPostDao
TODO: add Calendar.WEEK range support.
getBlogPosts
in interface BlogPostDao
spaceKey
- the space to look for posts indate
- a calendar object representing the date range we are looking for. Any part of
the calendar more specific than the supplied period will be ignored.period
- one of the Calendar constants specifying the granularity of the search.
currently, only Calendar.MONTH and Calendar.DATE are supportedpublic List getBlogPosts(@Nonnull Space space, @Nonnull Calendar date, int period)
BlogPostDao
TODO: add Calendar.WEEK range support.
getBlogPosts
in interface BlogPostDao
space
- the space to look for posts indate
- a calendar object representing the date range we are looking for. Any part of
the calendar more specific than the supplied period will be ignored.period
- one of the Calendar constants specifying the granularity of the search.
currently, only Calendar.MONTH and Calendar.DATE are supported@Deprecated public List getBlogPosts(String spaceKey, Calendar date, int period, int startIndex, int maxResultCount)
BlogPostDao
getBlogPosts
in interface BlogPostDao
spaceKey
- the space to look for posts indate
- a calendar object representing the date range we are looking for. Any part of
the calendar more specific than the supplied period will be ignored.period
- one of the Calendar constants specifying the granularity of the search.
currently, only Calendar.MONTH and Calendar.DATE are supportedstartIndex
- start number of postsmaxResultCount
- Maximum number of posts to returnpublic List getBlogPosts(@Nonnull Space space, @Nonnull Calendar date, int period, int startIndex, int maxResultCount)
BlogPostDao
getBlogPosts
in interface BlogPostDao
space
- the space to look for posts indate
- a calendar object representing the date range we are looking for. Any part of
the calendar more specific than the supplied period will be ignored.period
- one of the Calendar constants specifying the granularity of the search.
currently, only Calendar.MONTH and Calendar.DATE are supportedstartIndex
- start number of postsmaxResultCount
- Maximum number of posts to returnpublic long getBlogPostCount(String spaceKey, Calendar date, int period)
BlogPostDao
getBlogPostCount
in interface BlogPostDao
spaceKey
- the space to look for posts indate
- a calendar object representing the date range we are looking for. Any part of
the calendar more specific than the supplied period will be ignored.period
- one of the Calendar constants specifying the granularity of the search.
currently, only Calendar.MONTH and Calendar.DATE are supported@Deprecated public List<Date> getBlogPostDates(String spaceKey)
BlogPostDao
getBlogPostDates
in interface BlogPostDao
public List<Date> getBlogPostDates(@Nonnull Space space)
BlogPostDao
getBlogPostDates
in interface BlogPostDao
public List<Date> getBlogPostDates(String spaceKey, Calendar date, int period)
BlogPostDao
getBlogPostDates
in interface BlogPostDao
spaceKey
- the space to look for posts in.date
- a calendar object representing the date range we are looking for. Any part of
the calendar more specific than the supplied period will be ignored.period
- one of the Calendar constants specifying the granularity of the search.
currently, only Calendar.YEAR, Calendar.MONTH and Calendar.DATE are supportedpublic List<BlogPost> getBlogPosts(Space space, boolean currentOnly)
BlogPostDao
getBlogPosts
in interface BlogPostDao
public List<Long> getCurrentBlogPostIds()
BlogPostDao
getCurrentBlogPostIds
in interface BlogPostDao
public List getRecentlyAddedBlogPosts(int maxCount, @Nullable String spaceKey)
BlogPostDao
getRecentlyAddedBlogPosts
in interface BlogPostDao
maxCount
- Maximum number of posts to returnspaceKey
- the spaceKey to look for the posts in. If this key is null, we look acrosns
all spacespublic BlogPost getFirstPostBefore(String spaceKey, Date creationDate)
BlogPostDao
getFirstPostBefore
in interface BlogPostDao
spaceKey
- the space to look increationDate
- the date the post must be beforepublic BlogPost getFirstPostAfter(String spaceKey, Date creationDate)
BlogPostDao
getFirstPostAfter
in interface BlogPostDao
spaceKey
- the space to look increationDate
- the date the post must be afterpublic BlogPost getFirstPostBefore(BlogPost post)
BlogPostDao
getFirstPostBefore
in interface BlogPostDao
post
- the blog post that this must preceedpublic BlogPost getFirstPostAfter(BlogPost post)
BlogPostDao
getFirstPostAfter
in interface BlogPostDao
post
- the blog post that this must be afterpublic List getRecentlyAddedBlogPosts(int maxPosts, Date timeSince, String spaceKey)
getRecentlyAddedBlogPosts
in interface BlogPostDao
public BlogPost getMostRecentBlogPost(String spaceKey)
getMostRecentBlogPost
in interface BlogPostDao
public int getBlogPostCount()
BlogPostDao
getBlogPostCount
in interface BlogPostDao
public int countCurrentBlogs()
BlogPostDao
countCurrentBlogs
in interface BlogPostDao
public int countDraftBlogs()
BlogPostDao
countDraftBlogs
in interface BlogPostDao
public int countBlogsWithUnpublishedChanges()
BlogPostDao
countBlogsWithUnpublishedChanges
in interface BlogPostDao
Copyright © 2003–2017 Atlassian. All rights reserved.