Package com.atlassian.bamboo.author
Class AuthorHibernateDao
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate5.support.HibernateDaoSupport
com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<ExtendedAuthor>
com.atlassian.bamboo.author.AuthorHibernateDao
- All Implemented Interfaces:
AuthorDao,BambooObjectDao<ExtendedAuthor>,org.springframework.beans.factory.InitializingBean
public class AuthorHibernateDao
extends BambooHibernateObjectDao<ExtendedAuthor>
implements AuthorDao
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@NotNull Collection<? extends ExtendedAuthor> findAll()Get allExtendedAuthorentitiesfindAuthorsByLinkedUser(@NotNull String userSearchString) Performs a case insensitive search for authors by their linkedUserName.findAuthorsByName(@NotNull String authorSearchString) Performs a case insensitive search for authors by their author name.findAuthorsThatStartWith(@NotNull String authorSearchString, boolean unlinkedOnly) Performs a case insensitive search for authors by their author name.findById(long id) Find anExtendedAuthorobject of a given id.@NotNull Set<ExtendedAuthor> @Nullable ExtendedAuthorgetAuthorByName(String name) getAuthorsByResultSummary(@NotNull ResultsSummary resultsSummary) Retrieve unique set of authors that contributed to commits related to a given ResultsSummary@NotNull List<ResultsSummary> getBuildResultsBrokenByAuthor(ExtendedAuthor author, int maxResultCount) @NotNull List<ResultsSummary> getBuildResultsFailedByAuthor(ExtendedAuthor author, int maxResultCount) @NotNull List<ResultsSummary> getBuildResultsFixedByAuthor(ExtendedAuthor author, int maxResultCount) @NotNull List<ResultsSummary> getBuildResultsSuccessfulByAuthor(ExtendedAuthor author, int maxResultCount) @NotNull List<ResultsSummary> getBuildResultsTriggeredByAuthor(ExtendedAuthor author, int maxResultCount) @NotNull List<ExtendedAuthor> getLinkedAuthorsForUser(com.atlassian.user.User user) intintintintint@NotNull List<ResultsSummary> getRecentResultsTriggeredByAuthors(List<ExtendedAuthor> authors, int daysToFilter) Retrieve all build results triggered by the author in the last X daysvoidunlinkLinkedAuthors(@NotNull String username) Removes all links between a user and author entities.voidupdateLinkedAuthors(@NotNull com.atlassian.user.User user, @NotNull List<Long> authorIds) Updates list of Authors linked to a User.Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao
convertSearchTermToLikeExpression, countAll, countWithRestriction, delete, deleteAll, executeCountQuery, findAll, findAll, findById, merge, save, saveAllMethods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactoryMethods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDaoMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.bamboo.author.AuthorDao
unlinkLinkedAuthors
-
Constructor Details
-
AuthorHibernateDao
-
-
Method Details
-
findById
Description copied from interface:AuthorDaoFind anExtendedAuthorobject of a given id.- Specified by:
findByIdin interfaceAuthorDao- Parameters:
id- id ofAuthorto be found- Returns:
ExtendedAuthorobject or null if not found
-
findAll
Description copied from interface:AuthorDaoGet allExtendedAuthorentities- Specified by:
findAllin interfaceAuthorDao- Returns:
- Collection of
ExtendedAuthor
-
getAuthorByName
- Specified by:
getAuthorByNamein interfaceAuthorDao- Parameters:
name-- Returns:
- a
ExtendedAuthorobject given an author name
-
getBuildResultsFailedByAuthor
@NotNull public @NotNull List<ResultsSummary> getBuildResultsFailedByAuthor(ExtendedAuthor author, int maxResultCount) - Specified by:
getBuildResultsFailedByAuthorin interfaceAuthorDao- Parameters:
author-maxResultCount-- Returns:
ListofBuildResultsSummarytriggered by author and failed
-
getBuildResultsSuccessfulByAuthor
@NotNull public @NotNull List<ResultsSummary> getBuildResultsSuccessfulByAuthor(ExtendedAuthor author, int maxResultCount) - Specified by:
getBuildResultsSuccessfulByAuthorin interfaceAuthorDao- Parameters:
author-maxResultCount-- Returns:
ListofBuildResultsSummarytriggered by author and succesful
-
getBuildResultsBrokenByAuthor
@NotNull public @NotNull List<ResultsSummary> getBuildResultsBrokenByAuthor(ExtendedAuthor author, int maxResultCount) - Specified by:
getBuildResultsBrokenByAuthorin interfaceAuthorDao- Parameters:
author-maxResultCount-- Returns:
ListofBuildResultsSummarybroken by author
-
getBuildResultsFixedByAuthor
@NotNull public @NotNull List<ResultsSummary> getBuildResultsFixedByAuthor(ExtendedAuthor author, int maxResultCount) - Specified by:
getBuildResultsFixedByAuthorin interfaceAuthorDao- Parameters:
author-maxResultCount-- Returns:
ListofBuildResultsSummaryfixed by author
-
getNumberOfFailedBuildsByAuthor
- Specified by:
getNumberOfFailedBuildsByAuthorin interfaceAuthorDao- Parameters:
author-- Returns:
- int
-
getNumberOfSuccessfulBuildsByAuthor
- Specified by:
getNumberOfSuccessfulBuildsByAuthorin interfaceAuthorDao- Parameters:
author-- Returns:
- int
-
getNumberOfBuildFixedByAuthor
- Specified by:
getNumberOfBuildFixedByAuthorin interfaceAuthorDao- Parameters:
author-- Returns:
- int
-
getNumberOfBuildBrokenByAuthor
- Specified by:
getNumberOfBuildBrokenByAuthorin interfaceAuthorDao- Parameters:
author-- Returns:
- int
-
getAllUnlinkedAuthors
- Specified by:
getAllUnlinkedAuthorsin interfaceAuthorDao- Returns:
SetofExtendedAuthorwhich are not yet linked to any user.
-
getLinkedAuthorsForUser
- Specified by:
getLinkedAuthorsForUserin interfaceAuthorDao- Parameters:
user-- Returns:
ListofExtendedAuthorwhich are linked to a given user.
-
getBuildResultsTriggeredByAuthor
@NotNull public @NotNull List<ResultsSummary> getBuildResultsTriggeredByAuthor(ExtendedAuthor author, int maxResultCount) - Specified by:
getBuildResultsTriggeredByAuthorin interfaceAuthorDao- Parameters:
author-maxResultCount-- Returns:
ListofBuildResultsSummarytriggered by author
-
getRecentResultsTriggeredByAuthors
@NotNull public @NotNull List<ResultsSummary> getRecentResultsTriggeredByAuthors(List<ExtendedAuthor> authors, int daysToFilter) Description copied from interface:AuthorDaoRetrieve all build results triggered by the author in the last X days- Specified by:
getRecentResultsTriggeredByAuthorsin interfaceAuthorDao- Parameters:
authors- the builds will be triggered bydaysToFilter- number of days to look back in history- Returns:
- all build results triggered by the author in the last X days
-
getNumberOfBuildsTriggeredByAuthor
- Specified by:
getNumberOfBuildsTriggeredByAuthorin interfaceAuthorDao- Parameters:
author-- Returns:
- int
-
unlinkLinkedAuthors
Description copied from interface:AuthorDaoRemoves all links between a user and author entities.- Specified by:
unlinkLinkedAuthorsin interfaceAuthorDao- Parameters:
username- name of the user
-
updateLinkedAuthors
public void updateLinkedAuthors(@NotNull @NotNull com.atlassian.user.User user, @NotNull @NotNull List<Long> authorIds) Description copied from interface:AuthorDaoUpdates list of Authors linked to a User. As a result of this operation onlyAuthors with id listed in authorIds will be linked to user- Specified by:
updateLinkedAuthorsin interfaceAuthorDao- Parameters:
user- userauthorIds- list ofAuthorid that should be linked to user
-
findAuthorsByLinkedUser
@NotNull public @NotNull List<Author> findAuthorsByLinkedUser(@NotNull @NotNull String userSearchString) Description copied from interface:AuthorDaoPerforms a case insensitive search for authors by their linkedUserName. userSearchString can appear anywhere in the linked user name.- Specified by:
findAuthorsByLinkedUserin interfaceAuthorDao- Parameters:
userSearchString- string to search for- Returns:
- any authors who's linkedusername match the given string.
-
findAuthorsByName
@NotNull public @NotNull List<Author> findAuthorsByName(@NotNull @NotNull String authorSearchString) Description copied from interface:AuthorDaoPerforms a case insensitive search for authors by their author name. AuthorSearchString can appear anywhere in the authors name.- Specified by:
findAuthorsByNamein interfaceAuthorDao- Parameters:
authorSearchString- string to search for- Returns:
- any authors who's author name match the given string.
-
findAuthorsThatStartWith
@NotNull public @NotNull List<Author> findAuthorsThatStartWith(@NotNull @NotNull String authorSearchString, boolean unlinkedOnly) Description copied from interface:AuthorDaoPerforms a case insensitive search for authors by their author name.- Specified by:
findAuthorsThatStartWithin interfaceAuthorDao- Parameters:
authorSearchString- string to search forunlinkedOnly- if true will only return users which have not been linked with a user already- Returns:
- any authors who's author name match the given string.
-
getAuthorsByResultSummary
@NotNull public @NotNull Set<Author> getAuthorsByResultSummary(@NotNull @NotNull ResultsSummary resultsSummary) Description copied from interface:AuthorDaoRetrieve unique set of authors that contributed to commits related to a given ResultsSummary- Specified by:
getAuthorsByResultSummaryin interfaceAuthorDao- Parameters:
resultsSummary- ResultsSummary- Returns:
- list of authors
-