public class HibernateLabelDao extends HibernateObjectDao<Label> implements LabelDaoInternal
HibernateObjectDao.Cacheability
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<Label> |
findByDetails(String name,
String namespace,
String owner)
Find all labels based on the details passed in.
|
List<Label> |
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<Label> |
findBySingleDegreeSeparation(Label label,
int maxResults)
Find the labels that are a single degree of separation away from the specified label.
|
List<Label> |
findBySingleDegreeSeparation(Label label,
String spaceKey,
int maxResults) |
List<Label> |
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<LabelSearchResult> |
findMostPopular(String namespace,
int maxResults)
Find the most popular labels.
|
List<LabelSearchResult> |
findMostPopularBySpace(String namespace,
String spaceKey,
int maxResults)
Find the most popular labels in the specified space.
|
List<Label> |
findRecentlyUsed(int maxResults) |
List<Label> |
findRecentlyUsedBySpace(String spaceKey,
int maxResults) |
List<Labelling> |
findRecentlyUsedLabelling(int maxResults) |
List<Labelling> |
findRecentlyUsedLabellingsBySpace(String spaceKey,
int maxResults) |
List<Labelling> |
findRecentlyUsedUserLabellings(String username,
int maxResults) |
List<Label> |
findRecentlyUsedUserLabels(String username,
int maxResults) |
List<Space> |
findSpacesContainingContentWithLabel(Label label) |
List<Space> |
findSpacesWithLabel(Label label) |
PageResponse<Label> |
findTeamLabelsByNamePrefix(String namePrefix,
LimitedRequest pageRequest)
Returns team-namespaced labels starting with the given string.
|
List<Label> |
findUnusedLabels() |
List<Labelling> |
getFavouriteLabellingsByContentIds(Collection<Long> contentIds,
com.atlassian.sal.api.user.UserKey userKey) |
List<Space> |
getFavouriteSpaces(String username) |
Class<Label> |
getPersistentClass()
Gets the type of
EntityObject this Dao works with. |
void |
setAttachmentManager(AttachmentManager attachmentManager) |
void |
setConfluenceUserDao(ConfluenceUserDao confluenceUserDao) |
void |
setContentEntityObjectDao(ContentEntityObjectDao contentEntityObjectDao) |
void |
setPageTemplateDao(PageTemplateDao pageTemplateDao) |
applyTransactionTimeout, applyTransactionTimeout, checkDaoConfig, createHibernateTemplate, findAll, findAllSorted, findAllSorted, findByClassIds, findByClassIdsFiltered, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getByClassId, getCountResult, getHibernateTemplate, getSession, getSessionFactory, index, indexEntity, refresh, refreshEntity, reIndex, reIndexEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity, setHibernateTemplate, setIndexer, setSessionFactory, unIndex, unIndexEntity, uniqueResult, updateEntityModificationData, updateModificationData
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
findAll, findAllSorted, findAllSorted, findByClassIds, findByClassIdsFiltered, refresh, refreshEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity
public Class<Label> getPersistentClass()
ObjectDaoInternal
EntityObject
this Dao works with.getPersistentClass
in interface ObjectDao
getPersistentClass
in interface ObjectDaoInternal<Label>
public Label findById(long id)
LabelDao
public Label findByLabel(Label label)
findByLabel
in interface LabelDao
public List<Label> 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<Label> 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<Label> 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<Label> findRecentlyUsedBySpace(String spaceKey, int maxResults)
findRecentlyUsedBySpace
in interface LabelDao
public List<Label> findRecentlyUsed(int maxResults)
findRecentlyUsed
in interface LabelDao
public List<Labelling> findRecentlyUsedLabelling(int maxResults)
findRecentlyUsedLabelling
in interface LabelDao
public List<Labelling> findRecentlyUsedLabellingsBySpace(String spaceKey, int maxResults)
findRecentlyUsedLabellingsBySpace
in interface LabelDao
public List<Label> findRecentlyUsedUserLabels(String username, int maxResults)
findRecentlyUsedUserLabels
in interface LabelDao
public List<Labelling> findRecentlyUsedUserLabellings(String username, int maxResults)
findRecentlyUsedUserLabellings
in interface LabelDao
public List<LabelSearchResult> findMostPopular(String namespace, int maxResults)
LabelDao
Label popularity is defined by the number of times a label has been used / applied to content.
findMostPopular
in interface LabelDao
maxResults
- Maximum size of list to returnpublic List<LabelSearchResult> 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<Label> findBySingleDegreeSeparation(EditableLabelable content, int maxResults)
LabelDao
This 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 LabelDao
content
- 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 LabelDao
public List<Label> findBySingleDegreeSeparation(Label label, int maxResults)
LabelDao
This 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 LabelDao
label
- the label to look for on pagesmaxResults
- the maximum number of results to returnpublic List<Label> 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
If 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<Space> findSpacesContainingContentWithLabel(Label label)
findSpacesContainingContentWithLabel
in interface LabelDao
public List<Space> 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<Space> getFavouriteSpaces(String username)
getFavouriteSpaces
in interface LabelDao
username
- username of label ownerpublic List<Label> findUnusedLabels()
findUnusedLabels
in interface LabelDao
public List<Labelling> getFavouriteLabellingsByContentIds(Collection<Long> contentIds, com.atlassian.sal.api.user.UserKey userKey)
getFavouriteLabellingsByContentIds
in interface LabelDao
public PageResponse<Label> findGlobalLabelsByNamePrefix(String namePrefix, LimitedRequest pageRequest)
LabelDao
findGlobalLabelsByNamePrefix
in interface LabelDao
public PageResponse<Label> findTeamLabelsByNamePrefix(String namePrefix, LimitedRequest pageRequest)
LabelDao
findTeamLabelsByNamePrefix
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–2020 Atlassian. All rights reserved.