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 Modifier and Type Field Description static Class<? extends Project>
PERSISTENT_CLASS
-
Constructor Summary
Constructors Constructor Description ProjectHibernateDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull Number
count()
@NotNull Number
countNonDeleted()
void
delete(@NotNull Project project)
Removes the given entity from the database@NotNull Collection<? extends Project>
findAll()
@NotNull Collection<? extends Project>
findAll(int firstResult, int maxResults)
@NotNull List<Long>
findAllProjectsIds()
@Nullable Project
findById(long id)
@NotNull List<Project>
getAllProjectsMarkedForDeletion()
@NotNull List<Project>
getEmptyProjects()
@Nullable BambooEntityOid
getMaxProjectOid(int serverKey)
Returns the maxBambooEntityOid
that's currently in use ofBambooEntityType.PROJECT
type, with the given server key.@NotNull List<Project>
getNonEmptyProjects()
Project
getProjectByKey(@NotNull String key)
Project
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 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
-
-
-
-
Method Detail
-
findById
@Nullable public @Nullable Project findById(long id)
- Specified by:
findById
in interfaceProjectDao
-
findAll
@NotNull public @NotNull Collection<? extends Project> findAll()
- Specified by:
findAll
in interfaceProjectDao
-
findAll
@NotNull public @NotNull Collection<? extends Project> findAll(int firstResult, int maxResults)
- Specified by:
findAll
in interfaceProjectDao
-
findAllProjectsIds
@NotNull public @NotNull List<Long> findAllProjectsIds()
- Specified by:
findAllProjectsIds
in interfaceProjectDao
- Returns:
- ids of all projects (not marked for deletion)
-
count
@NotNull public @NotNull Number count()
- Specified by:
count
in interfaceProjectDao
-
countNonDeleted
@NotNull public @NotNull Number countNonDeleted()
- Specified by:
countNonDeleted
in interfaceProjectDao
-
delete
public void delete(@NotNull @NotNull Project project)
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
public boolean isExistingProjectName(@NotNull @NotNull String projectName)
- Specified by:
isExistingProjectName
in interfaceProjectDao
-
isExistingProjectKey
public boolean isExistingProjectKey(@NotNull @NotNull String projectKey)
- Specified by:
isExistingProjectKey
in interfaceProjectDao
-
getProjectByKey
public Project getProjectByKey(@NotNull @NotNull String key)
- Specified by:
getProjectByKey
in interfaceProjectDao
-
getProjectByName
public Project getProjectByName(@NotNull @NotNull String projectName)
- Specified by:
getProjectByName
in interfaceProjectDao
-
getNonEmptyProjects
@NotNull public @NotNull List<Project> getNonEmptyProjects()
- Specified by:
getNonEmptyProjects
in interfaceProjectDao
- Returns:
- projects (not marked for deletion) with at least one top level plan (not marked for deletion)
-
getEmptyProjects
@NotNull public @NotNull List<Project> getEmptyProjects()
- Specified by:
getEmptyProjects
in interfaceProjectDao
- Returns:
- projects (not marked for deletion) without top level plans (not marked for deletion)
-
getAllProjectsMarkedForDeletion
@NotNull public @NotNull List<Project> getAllProjectsMarkedForDeletion()
- Specified by:
getAllProjectsMarkedForDeletion
in interfaceProjectDao
- Returns:
- all
Project
s that are marked for deletion..
-
getMaxProjectOid
@Nullable public @Nullable BambooEntityOid getMaxProjectOid(int serverKey)
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
-
-