com.atlassian.bamboo.persistence3
Interface BambooObjectDao<T extends BambooObject>

Type Parameters:
T - entity type
All Known Subinterfaces:
BuildResultsSummaryDao, ChainStageDao, PlanDao
All Known Implementing Classes:
BambooHibernateObjectDao, BuildResultsSummaryHibernateDao, ChainStageHibernateDao, PlanHibernateDao

public interface BambooObjectDao<T extends BambooObject>

Generic Dao for BambooObjects


Method Summary
 void delete(T t)
          Removes the given entity from the database
 long executeReturnLong(org.springframework.orm.hibernate.HibernateCallback callback)
          Excute a HibernateCallback and return Long
<E extends T>
java.util.Collection<E>
findAll(java.lang.Class<E> aClass)
          Finds all the entitites that implement the given Class
<E extends T>
E
findById(long id, java.lang.Class<E> aClass)
          Find an entity by its id
 void save(T t)
          Saves the given entity.
 

Method Detail

save

void save(@NotNull
          T t)
Saves the given entity. If the entity implementation is an instance of BambooEntityObject this method will: - update EntityObject.getLastModificationDate() - set EntityObject.getCreationDate() if the object has not been saved

Parameters:
t -

delete

void delete(@NotNull
            T t)
Removes the given entity from the database

Parameters:
t -

findAll

@NotNull
<E extends T> java.util.Collection<E> findAll(@NotNull
                                                      java.lang.Class<E> aClass)
Finds all the entitites that implement the given Class

Parameters:
aClass -
Returns:
entities

findById

@Nullable
<E extends T> E findById(long id,
                                  java.lang.Class<E> aClass)
Find an entity by its id

Parameters:
id -
aClass -
Returns:
entity

executeReturnLong

long executeReturnLong(@NotNull
                       org.springframework.orm.hibernate.HibernateCallback callback)
Excute a HibernateCallback and return Long

Parameters:
callback -
Returns:
long


Copyright © 2010 Atlassian. All Rights Reserved.