public class HibernateLabelDao extends HibernateObjectDao implements LabelDao
HibernateObjectDao.Cacheability
NON_CACHEABLE
Constructor and Description |
---|
HibernateLabelDao() |
Modifier and Type | Method and Description |
---|---|
void |
deleteLabellingBySpace(String key) |
PartialList<ContentEntityObject> |
findAllContentForAllLabels(int offset,
int maxResults,
Label... labels)
Retrieve all ContentEntityObjects which are labelled with ALL provided labels.
|
List<? extends EditableLabelable> |
findAllUserLabelledContent(String username) |
List |
findByDetails(String name,
String namespace,
String owner)
Find all labels based on the details passed in.
|
List |
findByDetailsInSpace(String name,
String namespace,
String owner,
String spaceKey)
Find all labels for a specific space, based on the details passed in.
|
List<Label> |
findByDetailsInSpaces(String name,
String namespace,
String owner,
Collection<Space> spaces)
Find all labels for a specific space, based on the details passed in.
|
Label |
findById(long id)
Find the label by its id.
|
Label |
findByLabel(Label label) |
List |
findBySingleDegreeSeparation(EditableLabelable content,
int maxResults)
Find the labels that are a single degree of separation away from the specified content.
|
List |
findBySingleDegreeSeparation(EditableLabelable content,
String spaceKey,
int maxResults) |
List |
findBySingleDegreeSeparation(Label label,
int maxResults)
Find the labels that are a single degree of separation away from the specified label.
|
List |
findBySingleDegreeSeparation(Label label,
String spaceKey,
int maxResults) |
List |
findBySpace(String spaceKey,
String namespace)
Find the labels used to label the content with the specified space.
|
int |
findContentCountForLabel(Label label) |
List<? extends EditableLabelable> |
findContentForLabel(Label label,
int maxResults)
Returns content with the specified label, ordered by content id.
|
PartialList<ContentEntityObject> |
findContentInSpaceForAllLabels(int offset,
int maxResults,
String spaceKey,
Label... labels)
Retrieve current ContentEntityObjects in the space which are labelled with ALL provided labels.
|
PartialList<ContentEntityObject> |
findContentInSpacesForAllLabels(int offset,
int maxResults,
Set<String> spaceKeys,
Label... labels)
Retrieve current ContentEntityObjects in the given spaces which are labelled with ALL provided labels.
|
List<? extends EditableLabelable> |
findCurrentContentForLabel(Label label)
Returns current content with the specified label, sorted by last modification date.
|
List<? extends EditableLabelable> |
findCurrentContentForLabelAndSpace(Label label,
String spaceKey)
Returns current content with the specified label and spaceKey.
|
<T extends EditableLabelable> |
findForAllLabels(Class<T> labelableClass,
int offset,
int maxResults,
Label... labels)
Retrieve current EditableLabelables which are labelled with ALL provided labels.
|
PartialList<EditableLabelable> |
findForAllLabels(int offset,
int maxResults,
Label... labelsArray)
Retrieve EditableLabelables which are labelled with ALL provided labels.
|
PageResponse<Label> |
findGlobalLabelsByNamePrefix(String namePrefix,
LimitedRequest pageRequest)
Returns global-namespaced labels starting with the given string.
|
Labelling |
findLabellingByContentAndLabel(EditableLabelable content,
Label label) |
Labelling |
findLabellingById(long id) |
List |
findMostPopular(String namespace,
int maxResults)
Find the most popular labels.
|
List |
findMostPopularBySpace(String namespace,
String spaceKey,
int maxResults)
Find the most popular labels in the specified space.
|
List |
findRecentlyUsed(int maxResults) |
List |
findRecentlyUsedBySpace(String spaceKey,
int maxResults) |
List |
findRecentlyUsedLabelling(int maxResults) |
List |
findRecentlyUsedLabellingsBySpace(String spaceKey,
int maxResults) |
List |
findRecentlyUsedUserLabellings(String username,
int maxResults) |
List |
findRecentlyUsedUserLabels(String username,
int maxResults) |
List |
findSpacesContainingContentWithLabel(Label label) |
List |
findSpacesWithLabel(Label label) |
List |
findUnusedLabels() |
List |
getFavouriteSpaces(String username) |
Class |
getPersistentClass() |
void |
setAttachmentManager(AttachmentManager attachmentManager) |
void |
setConfluenceUserDao(ConfluenceUserDao confluenceUserDao) |
void |
setContentEntityObjectDao(ContentEntityObjectDao contentEntityObjectDao) |
void |
setForceSQL(boolean forceSQL) |
void |
setPageTemplateDao(PageTemplateDao pageTemplateDao) |
findAll, findAllSorted, 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, getByClassId, getCountResult, index, refresh, reIndex, remove, replicate, save, saveRaw, setIndexer, unIndex, uniqueResult, updateModificationData
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findAll, findAllSorted, findAllSorted, findByClassIds, refresh, remove, replicate, save, saveRaw
public void setForceSQL(boolean forceSQL)
public Class getPersistentClass()
getPersistentClass
in interface ObjectDao
public Label findById(long id)
LabelDao
public Label findByLabel(Label label)
findByLabel
in interface LabelDao
public List findByDetails(String name, String namespace, String owner)
LabelDao
The list of labels returned will be ordered by name.
findByDetails
in interface LabelDao
name
- Label name (can be null)namespace
- Namespace of the label (can be null)owner
- Owner of the label (can be null)public List findByDetailsInSpace(String name, String namespace, String owner, String spaceKey)
LabelDao
The list of labels returned will be ordered by name.
findByDetailsInSpace
in interface LabelDao
name
- Label name (can be null)namespace
- Namespace of the label (can be null)owner
- Owner of the label (can be null)spaceKey
- Key of the space whose content must have the returned labels (can be null)public List<Label> findByDetailsInSpaces(String name, String namespace, String owner, Collection<Space> spaces)
LabelDao
The list of labels returned will be ordered by name.
findByDetailsInSpaces
in interface LabelDao
name
- Label name (can be null)namespace
- Namespace of the label (can be null)owner
- Owner of the label (can be null)spaces
- Collection of spaces whose content must have the returned labels (can be null)public List findBySpace(String spaceKey, String namespace)
LabelDao
findBySpace
in interface LabelDao
spaceKey
- Key of the space whose content must have the returned labels (can be null)namespace
- Namespace of the label (can be null)public List findRecentlyUsedBySpace(String spaceKey, int maxResults)
findRecentlyUsedBySpace
in interface LabelDao
public List findRecentlyUsed(int maxResults)
findRecentlyUsed
in interface LabelDao
public List findRecentlyUsedLabelling(int maxResults)
findRecentlyUsedLabelling
in interface LabelDao
public List findRecentlyUsedLabellingsBySpace(String spaceKey, int maxResults)
findRecentlyUsedLabellingsBySpace
in interface LabelDao
public List findRecentlyUsedUserLabels(String username, int maxResults)
findRecentlyUsedUserLabels
in interface LabelDao
public List findRecentlyUsedUserLabellings(String username, int maxResults)
findRecentlyUsedUserLabellings
in interface LabelDao
public List findMostPopular(String namespace, int maxResults)
LabelDao
findMostPopular
in interface LabelDao
maxResults
- Maximum size of list to returnpublic List findMostPopularBySpace(String namespace, String spaceKey, int maxResults)
LabelDao
findMostPopularBySpace
in interface LabelDao
spaceKey
- of the space whose content must have the returned labelsmaxResults
- allows you to specify the maximum number of results returned by this method. Leaving max results
at zero will return all of the results.public List findBySingleDegreeSeparation(EditableLabelable content, int maxResults)
LabelDao
findBySingleDegreeSeparation
in interface LabelDao
content
- the content object used to search for related labelsmaxResults
- specifies the number of labels to be returned.public List findBySingleDegreeSeparation(EditableLabelable content, String spaceKey, int maxResults)
findBySingleDegreeSeparation
in interface LabelDao
public List findBySingleDegreeSeparation(Label label, int maxResults)
LabelDao
findBySingleDegreeSeparation
in interface LabelDao
label
- the label to look for on pagesmaxResults
- the maximum number of results to returnpublic List findBySingleDegreeSeparation(Label label, String spaceKey, int maxResults)
findBySingleDegreeSeparation
in interface LabelDao
public List<? extends EditableLabelable> findAllUserLabelledContent(String username)
findAllUserLabelledContent
in interface LabelDao
public List<? extends EditableLabelable> findCurrentContentForLabel(Label label)
LabelDao
#findContentForLabel(Label)
.findCurrentContentForLabel
in interface LabelDao
label
- search for content with this labelpublic List<? extends EditableLabelable> findContentForLabel(Label label, int maxResults)
LabelDao
LabelDao.findCurrentContentForLabel(Label)
.findContentForLabel
in interface LabelDao
label
- search for content with this labelmaxResults
- the number of results to return; use -1 to get all resultspublic <T extends EditableLabelable> PartialList<T> findForAllLabels(Class<T> labelableClass, int offset, int maxResults, Label... labels)
LabelDao
findForAllLabels
in interface LabelDao
labelableClass
- the type of EditableLabelable to return. Use one of these values:
offset
- the offset into the resultsmaxResults
- the maximum number of results to returnlabels
- labels which must appear on ContentEntityObjectspublic PartialList<EditableLabelable> findForAllLabels(int offset, int maxResults, Label... labelsArray)
LabelDao
ContentEntityObject
s are returned in the list they may be current or in the trash.findForAllLabels
in interface LabelDao
offset
- the offset into the resultsmaxResults
- the maximum number of results to returnlabelsArray
- labels which must appear on ContentEntityObjectspublic PartialList<ContentEntityObject> findContentInSpaceForAllLabels(int offset, int maxResults, String spaceKey, Label... labels)
LabelDao
findContentInSpaceForAllLabels
in interface LabelDao
offset
- the offset into the resultsmaxResults
- the maximum number of results to returnspaceKey
- the key of the space to search inlabels
- labels which must appear on ContentEntityObjectspublic PartialList<ContentEntityObject> findContentInSpacesForAllLabels(int offset, int maxResults, Set<String> spaceKeys, Label... labels)
LabelDao
findContentInSpacesForAllLabels
in interface LabelDao
offset
- the offset into the resultsmaxResults
- the maximum number of results to returnspaceKeys
- the keys of the spaces to search inlabels
- labels which must appear on ContentEntityObjectspublic PartialList<ContentEntityObject> findAllContentForAllLabels(int offset, int maxResults, Label... labels)
LabelDao
findAllContentForAllLabels
in interface LabelDao
offset
- the offset into the resultsmaxResults
- the maximum number of results to returnlabels
- labels which must appear on ContentEntityObjectspublic int findContentCountForLabel(Label label)
findContentCountForLabel
in interface LabelDao
public List<? extends EditableLabelable> findCurrentContentForLabelAndSpace(Label label, String spaceKey)
LabelDao
findCurrentContentForLabelAndSpace
in interface LabelDao
label
- search for content with this labelspaceKey
- (optional) search for content belonging to the space with this spaceKeypublic List findSpacesContainingContentWithLabel(Label label)
findSpacesContainingContentWithLabel
in interface LabelDao
public List findSpacesWithLabel(Label label)
findSpacesWithLabel
in interface LabelDao
public Labelling findLabellingByContentAndLabel(EditableLabelable content, Label label)
findLabellingByContentAndLabel
in interface LabelDao
public Labelling findLabellingById(long id)
findLabellingById
in interface LabelDao
public void deleteLabellingBySpace(String key)
deleteLabellingBySpace
in interface LabelDao
public List getFavouriteSpaces(String username)
getFavouriteSpaces
in interface LabelDao
username
- username of label ownerpublic List findUnusedLabels()
findUnusedLabels
in interface LabelDao
public PageResponse<Label> findGlobalLabelsByNamePrefix(String namePrefix, LimitedRequest pageRequest)
LabelDao
findGlobalLabelsByNamePrefix
in interface LabelDao
public void setConfluenceUserDao(ConfluenceUserDao confluenceUserDao)
public void setPageTemplateDao(PageTemplateDao pageTemplateDao)
public void setContentEntityObjectDao(ContentEntityObjectDao contentEntityObjectDao)
public void setAttachmentManager(AttachmentManager attachmentManager)
Copyright © 2003–2015 Atlassian. All rights reserved.