com.atlassian.bamboo.persistence3
Class BambooHibernateObjectDao<T extends BambooObject>

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate.support.HibernateDaoSupport
          extended by com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<T>
All Implemented Interfaces:
BambooObjectDao<T>, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
ArtifactDefinitionHibernateDao, ArtifactSubscriptionHibernateDao, BambooTrustedApplicationsHibernateDao, BuildResultsSummaryHibernateDao, ChainStageHibernateDao, ConsumedSubscriptionHibernateDao, HibernateAuditLogDao, PlanHibernateDao, VariableDefinitionHibernateDao

public abstract class BambooHibernateObjectDao<T extends BambooObject>
extends org.springframework.orm.hibernate.support.HibernateDaoSupport
implements BambooObjectDao<T>


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
BambooHibernateObjectDao()
           
 
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
 
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
 

Constructor Detail

BambooHibernateObjectDao

public BambooHibernateObjectDao()
Method Detail

save

public void save(@NotNull
                 T t)
Description copied from interface: BambooObjectDao
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

Specified by:
save in interface BambooObjectDao<T extends BambooObject>
Parameters:
t - entity to be saved

saveAll

public <E extends T> void saveAll(@NotNull
                                  java.util.Collection<E> entities)
Description copied from interface: BambooObjectDao
Save all entities in the collection to the database

Specified by:
saveAll in interface BambooObjectDao<T extends BambooObject>
Parameters:
entities - entities to be saved to database

delete

public void delete(@NotNull
                   T t)
Description copied from interface: BambooObjectDao
Removes the given entity from the database

Specified by:
delete in interface BambooObjectDao<T extends BambooObject>
Parameters:
t - entity to be removed

deleteAll

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

Specified by:
deleteAll in interface BambooObjectDao<T extends BambooObject>
Parameters:
entities - elements to be removed from database

findAll

@NotNull
public <E extends T> java.util.Collection<E> findAll(@NotNull
                                                             java.lang.Class<E> aClass)
Description copied from interface: BambooObjectDao
Finds all the entities that implement the given Class

Specified by:
findAll in interface BambooObjectDao<T extends BambooObject>
Parameters:
aClass - class of entity
Returns:
entities

findById

@Nullable
public <E extends T> E findById(long id,
                                         @NotNull
                                         java.lang.Class<E> aClass)
Description copied from interface: BambooObjectDao
Find an entity by its id

Specified by:
findById in interface BambooObjectDao<T extends BambooObject>
Parameters:
id - id of entity
aClass - class of entity
Returns:
entity

executeReturnLong

public long executeReturnLong(@NotNull
                              org.springframework.orm.hibernate.HibernateCallback callback)
Description copied from interface: BambooObjectDao
Execute a HibernateCallback and return Long

Specified by:
executeReturnLong in interface BambooObjectDao<T extends BambooObject>
Parameters:
callback - callback to be executed
Returns:
long


Copyright © 2011 Atlassian. All Rights Reserved.