|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.dao.support.DaoSupport org.springframework.orm.hibernate.support.HibernateDaoSupport com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<Plan> com.atlassian.bamboo.plan.PlanHibernateDao<T>
public class PlanHibernateDao<T extends Plan>
Field Summary |
---|
Fields inherited from class org.springframework.dao.support.DaoSupport |
---|
logger |
Constructor Summary | |
---|---|
PlanHibernateDao()
|
Method Summary | ||
---|---|---|
java.util.Set<TopLevelPlan> |
filterFavouritedPlans(java.util.Collection<TopLevelPlan> plans,
com.atlassian.user.User user)
Return a collection of TopLevelPlan s that are a subset of the given Build s collection that are favourited by the User |
|
|
findAllPlans(java.lang.Class<T> planType)
Return a Plan collection for specified plan type |
|
|
findAllPlansByProject(Project project,
java.lang.Class<T> planType)
Return a Plan collection for specified Project , including plans marked for deletion. |
|
|
findById(long id,
java.lang.Class<E> aClass)
Find an entity by its id |
|
|
findPlansByProject(Project project,
java.lang.Class<T> planType)
Return a Plan collection for specified Project |
|
|
getAllPlansMarkedForDeletion(java.lang.Class<T> planType)
Returns a list of Plan s that are com.atlassian.bamboo.plan.Plan#markForDeletion() for the given type |
|
|
getPlanByKey(java.lang.String planKey,
java.lang.Class<T> aClass)
Return a Plan that matches the given key |
|
|
getPlanByName(java.lang.String projectKey,
java.lang.String planName,
java.lang.Class<T> planType)
Returns a Plan from a project with the given plan name and Class
It is not possible to use this method if the planType parameter is a marker interface type such as Plan , Buildable or TopLevelPlan
since it is possible to have a Chain and a Job that share the same name. |
|
|
getPlanByPartialKeyAndName(PlanKey partialPlanKey,
java.lang.String planName,
java.lang.Class<T> planType)
Returns a Plan that matches the start of the given PlanKey and name |
|
|
getPlanCount(java.lang.Class<T> planType)
How many plans filtered by Class currently exist |
|
Plan |
getPlanSkeletonForPermissionCheckingByKey(java.lang.String planKey)
Return a Plan skeleton providing ONLY id and key, that matches the given key
This method should be used only for permission checking using Acegi
If Job key is provided as a parameter, parent Chain will be returned anyway, as Acegi assertions are defined only for TopLevelPlan s |
|
void |
save(Plan plan)
Saves the given entity. |
|
void |
setPlanDiscriminatorRegistry(PlanDiscriminatorRegistry planDiscriminatorRegistry)
|
Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao |
---|
delete, deleteAll, executeReturnLong, findAll, saveAll |
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.persistence3.BambooObjectDao |
---|
delete, deleteAll, executeReturnLong, findAll, saveAll |
Constructor Detail |
---|
public PlanHibernateDao()
Method Detail |
---|
public <T extends Plan> T getPlanByKey(@NotNull java.lang.String planKey, java.lang.Class<T> aClass)
PlanDao
Plan
that matches the given key
getPlanByKey
in interface PlanDao
@Nullable public Plan getPlanSkeletonForPermissionCheckingByKey(@NotNull java.lang.String planKey)
PlanDao
Plan
skeleton providing ONLY id and key, that matches the given key
This method should be used only for permission checking using Acegi
If Job
key is provided as a parameter, parent Chain will be returned anyway, as Acegi assertions are defined only for TopLevelPlan
s
getPlanSkeletonForPermissionCheckingByKey
in interface PlanDao
public <E extends Plan> E findById(long id, @NotNull java.lang.Class<E> aClass)
BambooObjectDao
findById
in interface BambooObjectDao<Plan>
findById
in class BambooHibernateObjectDao<Plan>
id
- id of entityaClass
- class of entity
public <T extends Plan> T getPlanByName(@NotNull java.lang.String projectKey, @NotNull java.lang.String planName, java.lang.Class<T> planType)
PlanDao
Plan
from a project with the given plan name and Class
It is not possible to use this method if the planType parameter is a marker interface type such as Plan
, Buildable
or TopLevelPlan
since it is possible to have a Chain
and a Job
that share the same name.
getPlanByName
in interface PlanDao
projectKey
- of the project to look for the plan inplanName
- - name of the plan inside the project: this is just the plan component of the name (i.e does not include the project component)planType
- - the type of the plan to retrieve
@Nullable public <T extends Plan> T getPlanByPartialKeyAndName(@NotNull PlanKey partialPlanKey, @NotNull java.lang.String planName, java.lang.Class<T> planType)
PlanDao
Plan
that matches the start of the given PlanKey
and name
getPlanByPartialKeyAndName
in interface PlanDao
public <T extends Plan> int getPlanCount(java.lang.Class<T> planType)
PlanDao
Class
currently exist
getPlanCount
in interface PlanDao
@NotNull public <T extends Plan> java.util.List<T> findPlansByProject(@NotNull Project project, java.lang.Class<T> planType)
PlanDao
Plan
collection for specified Project
findPlansByProject
in interface PlanDao
@NotNull public <T extends Plan> java.util.List<T> findAllPlansByProject(@NotNull Project project, java.lang.Class<T> planType)
PlanDao
Plan
collection for specified Project
, including plans marked for deletion.
findAllPlansByProject
in interface PlanDao
@NotNull public <T extends Plan> java.util.List<T> findAllPlans(java.lang.Class<T> planType)
PlanDao
Plan
collection for specified plan type
findAllPlans
in interface PlanDao
planType
- type of plan to be selected from DB
Plan
collection for specified plan typepublic void setPlanDiscriminatorRegistry(PlanDiscriminatorRegistry planDiscriminatorRegistry)
public java.util.Set<TopLevelPlan> filterFavouritedPlans(@NotNull java.util.Collection<TopLevelPlan> plans, @NotNull com.atlassian.user.User user)
PlanDao
TopLevelPlan
s that are a subset of the given Build
s collection that are favourited by the User
filterFavouritedPlans
in interface PlanDao
@NotNull public <T extends Plan> java.util.Collection<T> getAllPlansMarkedForDeletion(java.lang.Class<T> planType)
PlanDao
Plan
s that are com.atlassian.bamboo.plan.Plan#markForDeletion()
for the given type
getAllPlansMarkedForDeletion
in interface PlanDao
public void save(@NotNull Plan plan)
BambooObjectDao
BambooEntityObject
this method will:
- update EntityObject.getLastModificationDate()
- set EntityObject.getCreationDate()
if the object has not been saved
save
in interface BambooObjectDao<Plan>
save
in class BambooHibernateObjectDao<Plan>
plan
- entity to be saved
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |