Package com.atlassian.bamboo.quickfilter
Class QuickFilterHibernateDao
java.lang.Object
org.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate5.support.HibernateDaoSupport
com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
com.atlassian.bamboo.persistence3.BambooHibernateObjectDao<QuickFilter>
com.atlassian.bamboo.quickfilter.QuickFilterHibernateDao
- All Implemented Interfaces:
BambooObjectDao<QuickFilter>,QuickFilterDao,org.springframework.beans.factory.InitializingBean
@NotThreadSafe
public class QuickFilterHibernateDao
extends BambooHibernateObjectDao<QuickFilter>
implements QuickFilterDao
-
Field Summary
Fields inherited from class org.springframework.dao.support.DaoSupport
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreate(@NotNull QuickFilter quickFilter) Creates a new quick filter.voiddelete(@NotNull QuickFilter quickFilter) Removes the given entity from the database@NotNull List<QuickFilter>findAll()Returns all quick filters ordered by theirposition.@Nullable QuickFilterfindById(long id) @Nullable QuickFilterfindByName(@NotNull String name) voidsave(@NotNull QuickFilter quickFilter) Saves the given entity.<E extends QuickFilter>
voidsaveAll(@NotNull Collection<E> entities) Save all entities in the collection to the databaselongscrollQuickFiltersForExport(@NotNull Consumer<QuickFilter> consumer) Scroll through all QuickFilter records and pass them to consumervoidupdate(@NotNull QuickFilter quickFilter, int previousPosition) Updates a quick filter.Methods inherited from class com.atlassian.bamboo.persistence3.BambooHibernateObjectDao
convertSearchTermToLikeExpression, countAll, countWithRestriction, deleteAll, executeCountQuery, findAll, findById, mergeMethods inherited from class com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
getCacheAwareHibernateTemplateMethods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, setHibernateTemplate, setSessionFactoryMethods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDaoMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
countAll, countWithRestriction, deleteAll, findAll, findById, merge
-
Constructor Details
-
QuickFilterHibernateDao
public QuickFilterHibernateDao()
-
-
Method Details
-
findById
- Specified by:
findByIdin interfaceQuickFilterDao
-
findByName
- Specified by:
findByNamein interfaceQuickFilterDao
-
findAll
Description copied from interface:QuickFilterDaoReturns all quick filters ordered by theirposition.- Specified by:
findAllin interfaceQuickFilterDao- Returns:
- ordered list of quick filters
-
save
Description copied from interface:BambooObjectDaoSaves the given entity. If the entity implementation is an instance ofEntityObjectthis method will: - updateEntityObject.getLastModificationDate()- setEntityObject.getCreationDate()if the object has not been saved- Specified by:
savein interfaceBambooObjectDao<QuickFilter>- Specified by:
savein interfaceQuickFilterDao- Overrides:
savein classBambooHibernateObjectDao<QuickFilter>- Parameters:
quickFilter- entity to be saved
-
saveAll
Description copied from interface:BambooObjectDaoSave all entities in the collection to the database- Specified by:
saveAllin interfaceBambooObjectDao<QuickFilter>- Specified by:
saveAllin interfaceQuickFilterDao- Overrides:
saveAllin classBambooHibernateObjectDao<QuickFilter>- Parameters:
entities- entities to be saved to database
-
create
Description copied from interface:QuickFilterDaoCreates a new quick filter. This method must be used instead of directly callingQuickFilterDao.save(QuickFilter)to maintain database integrity related to quick filter positions. If the quick filter doesn't have a position defined, it will be assigned one. If instead it has a position defined, then other persisted quick filters will be repositioned accordingly.- Specified by:
createin interfaceQuickFilterDao- Parameters:
quickFilter- entity to create, with or without defined position.
-
update
Description copied from interface:QuickFilterDaoUpdates a quick filter. This method must be used instead of directly callingQuickFilterDao.save(QuickFilter)to maintain database integrity related to quick filter positions. After the update, other persisted quick filters will be repositioned if necessary.- Specified by:
updatein interfaceQuickFilterDao- Parameters:
quickFilter- entity to updatepreviousPosition- previous position of the quick filter
-
scrollQuickFiltersForExport
Description copied from interface:QuickFilterDaoScroll through all QuickFilter records and pass them to consumer- Specified by:
scrollQuickFiltersForExportin interfaceQuickFilterDao
-
delete
Description copied from interface:BambooObjectDaoRemoves the given entity from the database- Specified by:
deletein interfaceBambooObjectDao<QuickFilter>- Overrides:
deletein classBambooHibernateObjectDao<QuickFilter>- Parameters:
quickFilter- entity to be removed
-