public class HibernateLabelDao extends HibernateObjectDao implements LabelDao
HibernateObjectDao.CacheabilityNON_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<Label> |
findBySingleDegreeSeparation(EditableLabelable content,
int maxResults)
Find the labels that are a single degree of separation away from the specified content.
|
List<Label> |
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<Labelling> |
getFavouriteLabellingsByContentIds(Collection<Long> contentIds,
com.atlassian.sal.api.user.UserKey userKey) |
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) |
applyTransactionTimeout, applyTransactionTimeout, checkDaoConfig, createHibernateTemplate, 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, getHibernateTemplate, getSession, getSessionFactory, index, refresh, reIndex, remove, replicate, save, saveRaw, setHibernateTemplate, setIndexer, setSessionFactory, unIndex, uniqueResult, updateModificationDataclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfindAll, findAllSorted, findAllSorted, findByClassIds, refresh, remove, replicate, save, saveRawpublic void setForceSQL(boolean forceSQL)
public Class getPersistentClass()
getPersistentClass in interface ObjectDaopublic Label findById(long id)
LabelDaopublic Label findByLabel(Label label)
findByLabel in interface LabelDaopublic List findByDetails(String name, String namespace, String owner)
LabelDaoThe list of labels returned will be ordered by name.
findByDetails in interface LabelDaoname - 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)
LabelDaoThe list of labels returned will be ordered by name.
findByDetailsInSpace in interface LabelDaoname - 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)
LabelDaoThe list of labels returned will be ordered by name.
findByDetailsInSpaces in interface LabelDaoname - 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)
LabelDaofindBySpace in interface LabelDaospaceKey - 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 LabelDaopublic List findRecentlyUsed(int maxResults)
findRecentlyUsed in interface LabelDaopublic List findRecentlyUsedLabelling(int maxResults)
findRecentlyUsedLabelling in interface LabelDaopublic List findRecentlyUsedLabellingsBySpace(String spaceKey, int maxResults)
findRecentlyUsedLabellingsBySpace in interface LabelDaopublic List findRecentlyUsedUserLabels(String username, int maxResults)
findRecentlyUsedUserLabels in interface LabelDaopublic List findRecentlyUsedUserLabellings(String username, int maxResults)
findRecentlyUsedUserLabellings in interface LabelDaopublic List findMostPopular(String namespace, int maxResults)
LabelDaoLabel popularity is defined by the number of times a label has been used / applied to content.
findMostPopular in interface LabelDaomaxResults - Maximum size of list to returnpublic List findMostPopularBySpace(String namespace, String spaceKey, int maxResults)
LabelDaofindMostPopularBySpace in interface LabelDaospaceKey - 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<Label> findBySingleDegreeSeparation(EditableLabelable content, int maxResults)
LabelDaoThis query will retrieve the labels on the given content object and find any content with those labels. The labels that are used on the second "level" of content will be returned.
e.g. Page H is passed in as the content object, which is labelled with A and B. All pages labelled with A and B are retrieved (J, K, L, M), and the labels on those four pages are returned in order of frequency.
findBySingleDegreeSeparation in interface LabelDaocontent - the content object used to search for related labelsmaxResults - specifies the number of labels to be returned.public List<Label> findBySingleDegreeSeparation(EditableLabelable content, String spaceKey, int maxResults)
findBySingleDegreeSeparation in interface LabelDaopublic List findBySingleDegreeSeparation(Label label, int maxResults)
LabelDaoThis query will return the labels located on the same pages with the given label, in order of frequency
e.g. Page A has labels ABCX, Page B has labels ABX. A query for X will return A (2 uses) then B (1 use)
findBySingleDegreeSeparation in interface LabelDaolabel - 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 LabelDaopublic List<? extends EditableLabelable> findAllUserLabelledContent(String username)
findAllUserLabelledContent in interface LabelDaopublic List<? extends EditableLabelable> findCurrentContentForLabel(Label label)
LabelDao#findContentForLabel(Label).findCurrentContentForLabel in interface LabelDaolabel - search for content with this labelpublic List<? extends EditableLabelable> findContentForLabel(Label label, int maxResults)
LabelDaoLabelDao.findCurrentContentForLabel(Label).findContentForLabel in interface LabelDaolabel - 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)
LabelDaofindForAllLabels in interface LabelDaolabelableClass - 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
If ContentEntityObjects are returned in the list they may be current or in the trash.
findForAllLabels in interface LabelDaooffset - 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)
LabelDaofindContentInSpaceForAllLabels in interface LabelDaooffset - 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)
LabelDaofindContentInSpacesForAllLabels in interface LabelDaooffset - 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)
LabelDaofindAllContentForAllLabels in interface LabelDaooffset - 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 LabelDaopublic List<? extends EditableLabelable> findCurrentContentForLabelAndSpace(Label label, String spaceKey)
LabelDaofindCurrentContentForLabelAndSpace in interface LabelDaolabel - search for content with this labelspaceKey - (optional) search for content belonging to the space with this spaceKeypublic List findSpacesContainingContentWithLabel(Label label)
findSpacesContainingContentWithLabel in interface LabelDaopublic List findSpacesWithLabel(Label label)
findSpacesWithLabel in interface LabelDaopublic Labelling findLabellingByContentAndLabel(EditableLabelable content, Label label)
findLabellingByContentAndLabel in interface LabelDaopublic Labelling findLabellingById(long id)
findLabellingById in interface LabelDaopublic void deleteLabellingBySpace(String key)
deleteLabellingBySpace in interface LabelDaopublic List getFavouriteSpaces(String username)
getFavouriteSpaces in interface LabelDaousername - username of label ownerpublic List findUnusedLabels()
findUnusedLabels in interface LabelDaopublic List<Labelling> getFavouriteLabellingsByContentIds(Collection<Long> contentIds, com.atlassian.sal.api.user.UserKey userKey)
getFavouriteLabellingsByContentIds in interface LabelDaopublic PageResponse<Label> findGlobalLabelsByNamePrefix(String namePrefix, LimitedRequest pageRequest)
LabelDaofindGlobalLabelsByNamePrefix in interface LabelDaopublic void setConfluenceUserDao(ConfluenceUserDao confluenceUserDao)
public void setPageTemplateDao(PageTemplateDao pageTemplateDao)
public void setContentEntityObjectDao(ContentEntityObjectDao contentEntityObjectDao)
public void setAttachmentManager(AttachmentManager attachmentManager)
Copyright © 2003–2017 Atlassian. All rights reserved.