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
-
-
Constructor Summary
Constructors Constructor Description QuickFilterHibernateDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreate(@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, 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 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
-
-
-
-
Method Detail
-
findById
@Nullable public @Nullable QuickFilter findById(long id)
- Specified by:
findByIdin interfaceQuickFilterDao
-
findByName
@Nullable public @Nullable QuickFilter findByName(@NotNull @NotNull String name)
- Specified by:
findByNamein interfaceQuickFilterDao
-
findAll
@NotNull public @NotNull List<QuickFilter> findAll()
Description copied from interface:QuickFilterDaoReturns all quick filters ordered by theirposition.- Specified by:
findAllin interfaceQuickFilterDao- Returns:
- ordered list of quick filters
-
save
public void save(@NotNull @NotNull QuickFilter quickFilter)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
public <E extends QuickFilter> void saveAll(@NotNull @NotNull Collection<E> entities)
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
public void create(@NotNull @NotNull QuickFilter quickFilter)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
public void update(@NotNull @NotNull QuickFilter quickFilter, int previousPosition)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
public long scrollQuickFiltersForExport(@NotNull @NotNull Consumer<QuickFilter> consumer)Description copied from interface:QuickFilterDaoScroll through all QuickFilter records and pass them to consumer- Specified by:
scrollQuickFiltersForExportin interfaceQuickFilterDao
-
delete
public void delete(@NotNull @NotNull QuickFilter quickFilter)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
-
-