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.StatelessSessionHibernateDaoSupport
              extended by com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<T>
All Implemented Interfaces:
BambooObjectDao<T>, org.springframework.beans.factory.InitializingBean
Direct Known Subclasses:
ArtifactDefinitionHibernateDao, ArtifactSubscriptionHibernateDao, AuthorHibernateDao, BambooTrustedApplicationsHibernateDao, BranchCommitInformationHibernateDao, BuildResultsSummaryHibernateDao, CapabilityDaoImpl, ChainStageHibernateDao, CommentHibernateDao, CommitHibernateDao, ConsumedSubscriptionHibernateDao, EnvironmentDaoImpl, EnvironmentRepositoryLinkHibernateDao, HibernateAuditLogDao, LinkedJiraIssueHibernateDao, LoginInformationHibernateDao, MergeResultSummaryDaoImpl, PlanHibernateDao, PlanRepositoryLinkHibernateDao, PlanVcsRevisionHistoryHibernateDao, PlanVcsRevisionHistoryHibernateStandaloneDao, ProjectHibernateDao, RemoteAgentAuthenticationHibernateDao, RepositoryChangesetHibernateDao, RepositoryDefinitionHibernateDao, TestCaseHibernateDao, TestCaseResultHibernateDao, TestResultsHibernateDao, TestsHibernateDao, VariableContextBaselineHibernateDao, VariableDefinitionHibernateDao, VcsBranchHibernateDao

public abstract class BambooHibernateObjectDao<T extends BambooObject>
extends StatelessSessionHibernateDaoSupport
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
<E extends T>
E
execute(org.springframework.orm.hibernate.HibernateCallback action)
           
 long executeCountQuery(java.lang.String queryName)
          Execute count-type query and returns result
<E extends T>
java.util.List<E>
executeFind(org.springframework.orm.hibernate.HibernateCallback action)
           
 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 com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
getCacheAwareHibernateTemplate
 
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

execute

@Nullable
public <E extends T> E execute(@NotNull
                                        org.springframework.orm.hibernate.HibernateCallback action)
                    throws org.springframework.dao.DataAccessException
Throws:
org.springframework.dao.DataAccessException

executeFind

@NotNull
public <E extends T> java.util.List<E> executeFind(@NotNull
                                                           org.springframework.orm.hibernate.HibernateCallback action)
                                        throws org.springframework.dao.DataAccessException
Throws:
org.springframework.dao.DataAccessException

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

executeCountQuery

public long executeCountQuery(@NotNull
                              java.lang.String queryName)
Execute count-type query and returns result

Parameters:
queryName - name of the named query to execute
Returns:
value returned by query


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.