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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
create
(@NotNull QuickFilter quickFilter) Creates a new quick filter.void
delete
(@NotNull QuickFilter quickFilter) Removes the given entity from the database@NotNull List<QuickFilter>
findAll()
Returns all quick filters ordered by theirposition
.@Nullable QuickFilter
findById
(long id) @Nullable QuickFilter
findByName
(@NotNull String name) void
save
(@NotNull QuickFilter quickFilter) Saves the given entity.<E extends QuickFilter>
voidsaveAll
(@NotNull Collection<E> entities) Save all entities in the collection to the databaselong
scrollQuickFiltersForExport
(@NotNull Consumer<QuickFilter> consumer) Scroll through all QuickFilter records and pass them to consumervoid
update
(@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, merge
Methods inherited from class com.atlassian.bamboo.persistence3.StatelessSessionHibernateDaoSupport
getCacheAwareHibernateTemplate
Methods inherited from class org.springframework.orm.hibernate5.support.HibernateDaoSupport
checkDaoConfig, createHibernateTemplate, currentSession, getHibernateTemplate, getSessionFactory, 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
Methods inherited from interface com.atlassian.bamboo.persistence3.BambooObjectDao
countAll, countWithRestriction, deleteAll, findAll, findById, merge
-
Constructor Details
-
QuickFilterHibernateDao
public QuickFilterHibernateDao()
-
-
Method Details
-
findById
- Specified by:
findById
in interfaceQuickFilterDao
-
findByName
- Specified by:
findByName
in interfaceQuickFilterDao
-
findAll
Description copied from interface:QuickFilterDao
Returns all quick filters ordered by theirposition
.- Specified by:
findAll
in interfaceQuickFilterDao
- Returns:
- ordered list of quick filters
-
save
Description copied from interface:BambooObjectDao
Saves the given entity. If the entity implementation is an instance ofEntityObject
this method will: - updateEntityObject.getLastModificationDate()
- setEntityObject.getCreationDate()
if the object has not been saved- Specified by:
save
in interfaceBambooObjectDao<QuickFilter>
- Specified by:
save
in interfaceQuickFilterDao
- Overrides:
save
in classBambooHibernateObjectDao<QuickFilter>
- Parameters:
quickFilter
- entity to be saved
-
saveAll
Description copied from interface:BambooObjectDao
Save all entities in the collection to the database- Specified by:
saveAll
in interfaceBambooObjectDao<QuickFilter>
- Specified by:
saveAll
in interfaceQuickFilterDao
- Overrides:
saveAll
in classBambooHibernateObjectDao<QuickFilter>
- Parameters:
entities
- entities to be saved to database
-
create
Description copied from interface:QuickFilterDao
Creates 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:
create
in interfaceQuickFilterDao
- Parameters:
quickFilter
- entity to create, with or without defined position.
-
update
Description copied from interface:QuickFilterDao
Updates 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:
update
in interfaceQuickFilterDao
- Parameters:
quickFilter
- entity to updatepreviousPosition
- previous position of the quick filter
-
scrollQuickFiltersForExport
Description copied from interface:QuickFilterDao
Scroll through all QuickFilter records and pass them to consumer- Specified by:
scrollQuickFiltersForExport
in interfaceQuickFilterDao
-
delete
Description copied from interface:BambooObjectDao
Removes the given entity from the database- Specified by:
delete
in interfaceBambooObjectDao<QuickFilter>
- Overrides:
delete
in classBambooHibernateObjectDao<QuickFilter>
- Parameters:
quickFilter
- entity to be removed
-