com.atlassian.bamboo.build
Class BuildHibernateDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate.support.HibernateDaoSupport
          extended by com.atlassian.hibernate.HibernateObjectDao
              extended by com.atlassian.bamboo.persistence.BambooHibernateObjectDao
                  extended by com.atlassian.bamboo.build.BuildHibernateDao
All Implemented Interfaces:
bucket.core.persistence.ObjectDao, BuildDao, BambooObjectDao, org.springframework.beans.factory.InitializingBean

public class BuildHibernateDao
extends BambooHibernateObjectDao
implements BuildDao


Field Summary
 
Fields inherited from class com.atlassian.hibernate.HibernateObjectDao
log
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
BuildHibernateDao()
           
 
Method Summary
 java.util.Set<Build> filterFavouritedBuilds(java.util.Collection<Build> builds, com.atlassian.user.User user)
          Return a collection of Builds that are a subset of the given Builds collection that are favourited by the User
 java.util.Collection<Build> getAllBuilds()
          Returns all builds in the system
 Build getBuildByKey(java.lang.String key)
          Returns a Build object that matches the key.
 Build getBuildByName(java.lang.String buildName)
           
 Build getBuildByProjectAndName(java.lang.String projectKey, java.lang.String buildName)
           
 java.util.Collection getBuildsByProject(Project project)
           
 java.util.Collection<Build> getBuildsForDeletion()
          Returns all builds marked for deletion.
 java.lang.Class getPersistentClass()
           
 int getPlanCount()
          Return number of plans that currently exist in the database
 boolean isExistingBuildKey(java.lang.String projectKey, java.lang.String buildKey)
           
 boolean isExistingBuildName(java.lang.String projectKey, java.lang.String buildName)
           
 void saveBuild(Build build)
           
 void saveBuildAndDefinition(Build build)
           
 void updateBuild(Build build)
           
 
Methods inherited from class com.atlassian.bamboo.persistence.BambooHibernateObjectDao
executeCountQuery, executeReturnLong, findById, findById
 
Methods inherited from class com.atlassian.hibernate.HibernateObjectDao
findAll, findAllSorted, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getByClassId, index, refresh, reIndex, remove, replicate, save, saveRaw, setIndexer, unIndex, updateModificationData
 
Methods inherited from class org.springframework.orm.hibernate.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, 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.persistence.BambooObjectDao
findById
 
Methods inherited from interface bucket.core.persistence.ObjectDao
findAll, findAllSorted, refresh, remove, replicate, save, saveRaw
 

Constructor Detail

BuildHibernateDao

public BuildHibernateDao()
Method Detail

getPersistentClass

public java.lang.Class getPersistentClass()
Specified by:
getPersistentClass in interface bucket.core.persistence.ObjectDao

getBuildByKey

@Nullable
public Build getBuildByKey(java.lang.String key)
Description copied from interface: BuildDao
Returns a Build object that matches the key.

Specified by:
getBuildByKey in interface BuildDao
Parameters:
key - - must not be null
Returns:
the Build. Null if not founf

getAllBuilds

@NotNull
public java.util.Collection<Build> getAllBuilds()
Description copied from interface: BuildDao
Returns all builds in the system

Specified by:
getAllBuilds in interface BuildDao
Returns:
Collections.EMPTY_LIST

getBuildsForDeletion

@NotNull
public java.util.Collection<Build> getBuildsForDeletion()
Description copied from interface: BuildDao
Returns all builds marked for deletion.

Specified by:
getBuildsForDeletion in interface BuildDao
Returns:
List of Build. If no results Collections.EMPTY_LIST

updateBuild

public void updateBuild(Build build)
Specified by:
updateBuild in interface BuildDao

getBuildByName

public Build getBuildByName(java.lang.String buildName)
Specified by:
getBuildByName in interface BuildDao

getBuildsByProject

public java.util.Collection getBuildsByProject(Project project)
Specified by:
getBuildsByProject in interface BuildDao

saveBuildAndDefinition

public void saveBuildAndDefinition(Build build)
Specified by:
saveBuildAndDefinition in interface BuildDao

saveBuild

public void saveBuild(Build build)
Specified by:
saveBuild in interface BuildDao

isExistingBuildName

public boolean isExistingBuildName(java.lang.String projectKey,
                                   java.lang.String buildName)
Specified by:
isExistingBuildName in interface BuildDao

getBuildByProjectAndName

@Nullable
public Build getBuildByProjectAndName(java.lang.String projectKey,
                                               java.lang.String buildName)
Specified by:
getBuildByProjectAndName in interface BuildDao

isExistingBuildKey

public boolean isExistingBuildKey(java.lang.String projectKey,
                                  java.lang.String buildKey)
Specified by:
isExistingBuildKey in interface BuildDao

getPlanCount

public int getPlanCount()
Description copied from interface: BuildDao
Return number of plans that currently exist in the database

Specified by:
getPlanCount in interface BuildDao
Returns:
number of plans that currently exist in the database

filterFavouritedBuilds

public java.util.Set<Build> filterFavouritedBuilds(@NotNull
                                                   java.util.Collection<Build> builds,
                                                   @NotNull
                                                   com.atlassian.user.User user)
Description copied from interface: BuildDao
Return a collection of Builds that are a subset of the given Builds collection that are favourited by the User

Specified by:
filterFavouritedBuilds in interface BuildDao
Returns:
favoritedBuilds


Copyright © 2010 Atlassian. All Rights Reserved.