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

Type Parameters:
T - entity type
All Known Subinterfaces:
ArtifactDefinitionDao, ArtifactSubscriptionDao, AuditLogDao, BambooTrustedApplicationDao, BuildResultsSummaryDao, ChainStageDao, ConsumedSubscriptionDao, PlanDao, PlanVcsRevisionHistoryDao, PlanVcsRevisionHistoryStandaloneDao, VariableDefinitionDao
All Known Implementing Classes:
ArtifactDefinitionHibernateDao, ArtifactSubscriptionHibernateDao, BambooHibernateObjectDao, BambooTrustedApplicationsHibernateDao, BuildResultsSummaryHibernateDao, ChainStageHibernateDao, ConsumedSubscriptionHibernateDao, HibernateAuditLogDao, PlanHibernateDao, PlanVcsRevisionHistoryHibernateDao, PlanVcsRevisionHistoryHibernateStandaloneDao, VariableDefinitionHibernateDao

public interface BambooObjectDao<T extends BambooObject>

Generic Dao for BambooObjects


Method Summary
 void delete(T t)
          Removes the given entity from the database
<E extends T>
void
deleteAll(java.util.Collection<E> entities)
          Remove all elements in the collection from database
 long executeReturnLong(org.springframework.orm.hibernate.HibernateCallback callback)
          Execute a HibernateCallback and return Long
<E extends T>
java.util.Collection<E>
findAll(java.lang.Class<E> aClass)
          Finds all the entities 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.
<E extends T>
void
saveAll(java.util.Collection<E> entities)
          Save all entities in the collection to the database
 

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 - entity to be saved

saveAll

<E extends T> void saveAll(@NotNull
                           java.util.Collection<E> entities)
Save all entities in the collection to the database

Parameters:
entities - entities to be saved to database

delete

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

Parameters:
t - entity to be removed

deleteAll

<E extends T> void deleteAll(@NotNull
                             java.util.Collection<E> entities)
Remove all elements in the collection from database

Parameters:
entities - elements to be removed from database

findAll

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

Parameters:
aClass - class of entity
Returns:
entities

findById

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

Parameters:
id - id of entity
aClass - class of entity
Returns:
entity

executeReturnLong

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

Parameters:
callback - callback to be executed
Returns:
long


Copyright © 2011 Atlassian. All Rights Reserved.