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 void
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 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:
findById
in interfaceQuickFilterDao
-
findByName
@Nullable public @Nullable QuickFilter findByName(@NotNull @NotNull String name)
- Specified by:
findByName
in interfaceQuickFilterDao
-
findAll
@NotNull public @NotNull List<QuickFilter> 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
public void save(@NotNull @NotNull QuickFilter quickFilter)
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
public <E extends QuickFilter> void saveAll(@NotNull @NotNull Collection<E> entities)
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
public void create(@NotNull @NotNull QuickFilter quickFilter)
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
public void update(@NotNull @NotNull QuickFilter quickFilter, int previousPosition)
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
public long scrollQuickFiltersForExport(@NotNull @NotNull Consumer<QuickFilter> consumer)
Description copied from interface:QuickFilterDao
Scroll through all QuickFilter records and pass them to consumer- Specified by:
scrollQuickFiltersForExport
in interfaceQuickFilterDao
-
delete
public void delete(@NotNull @NotNull QuickFilter quickFilter)
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
-
-