Package com.atlassian.bamboo.project
Class ProjectHibernateDao
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate5.support.HibernateDaoSupport
com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<E>
com.atlassian.bamboo.persistence3.BambooHibernateObjectWithOidDao<Project>
com.atlassian.bamboo.project.ProjectHibernateDao
- All Implemented Interfaces:
BambooObjectDao<Project>
,BambooObjectWithOidDao<Project>
,ProjectDao
,org.springframework.beans.factory.InitializingBean
public class ProjectHibernateDao
extends BambooHibernateObjectWithOidDao<Project>
implements ProjectDao
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull Number
count()
@NotNull Number
void
Removes the given entity from the database@NotNull Collection<? extends Project>
findAll()
@NotNull Collection<? extends Project>
findAll
(int firstResult, int maxResults) findAllProjectsIds
(int startIndex, int maxResults) @Nullable Project
findById
(long id) @Nullable BambooEntityOid
getMaxProjectOid
(int serverKey) Returns the maxBambooEntityOid
that's currently in use ofBambooEntityType.PROJECT
type, with the given server key.getProjectByKey
(@NotNull String key) getProjectByName
(@NotNull String projectName) boolean
isExistingProjectKey
(@NotNull String projectKey) boolean
isExistingProjectName
(@NotNull String projectName) Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectWithOidDao
findByOid
Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao
convertSearchTermToLikeExpression, countAll, countWithRestriction, deleteAll, executeCountQuery, findAll, findById, merge, save, saveAll
Methods inherited from class com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
getCacheAwareHibernateTemplate
Methods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactory
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
countAll, countWithRestriction, deleteAll, findAll, findById, merge, save, saveAll
Methods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectWithOidDao
findByOid
-
Field Details
-
PERSISTENT_CLASS
-
-
Constructor Details
-
ProjectHibernateDao
public ProjectHibernateDao()
-
-
Method Details
-
findById
- Specified by:
findById
in interfaceProjectDao
-
findAll
- Specified by:
findAll
in interfaceProjectDao
-
findAll
- Specified by:
findAll
in interfaceProjectDao
-
findAllProjectsIds
- Specified by:
findAllProjectsIds
in interfaceProjectDao
- Returns:
- ids of all projects (not marked for deletion)
-
findAllProjectsIds
- Specified by:
findAllProjectsIds
in interfaceProjectDao
- Returns:
- ids of all projects (not marked for deletion)
-
count
- Specified by:
count
in interfaceProjectDao
-
countNonDeleted
- Specified by:
countNonDeleted
in interfaceProjectDao
-
delete
Description copied from interface:BambooObjectDao
Removes the given entity from the database- Specified by:
delete
in interfaceBambooObjectDao<Project>
- Specified by:
delete
in interfaceProjectDao
- Overrides:
delete
in classBambooHibernateObjectDao<Project>
- Parameters:
project
- entity to be removed
-
isExistingProjectName
- Specified by:
isExistingProjectName
in interfaceProjectDao
-
isExistingProjectKey
- Specified by:
isExistingProjectKey
in interfaceProjectDao
-
getProjectByKey
- Specified by:
getProjectByKey
in interfaceProjectDao
-
getProjectByName
- Specified by:
getProjectByName
in interfaceProjectDao
-
getNonEmptyProjects
- Specified by:
getNonEmptyProjects
in interfaceProjectDao
- Returns:
- projects (not marked for deletion) with at least one top level plan (not marked for deletion)
-
getEmptyProjects
- Specified by:
getEmptyProjects
in interfaceProjectDao
- Returns:
- projects (not marked for deletion) without top level plans (not marked for deletion)
-
getAllProjectsMarkedForDeletion
- Specified by:
getAllProjectsMarkedForDeletion
in interfaceProjectDao
- Returns:
- all
Project
s that are marked for deletion..
-
getMaxProjectOid
Description copied from interface:ProjectDao
Returns the maxBambooEntityOid
that's currently in use ofBambooEntityType.PROJECT
type, with the given server key. Returns null if no OIDs are in use of this type with the given server key.- Specified by:
getMaxProjectOid
in interfaceProjectDao
-