Package org.bonitasoft.engine.services
Interface PersistenceService
-
- All Superinterfaces:
ReadPersistenceService
- All Known Subinterfaces:
TenantPersistenceService
- All Known Implementing Classes:
AbstractDBPersistenceService,AbstractHibernatePersistenceService,PlatformHibernatePersistenceService,TenantHibernatePersistenceService
public interface PersistenceService extends ReadPersistenceService
- Author:
- Charles Souillard, Elias Ricken de Medeiros, Celine Souchet, Matthieu Chaffotte
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddelete(long id, java.lang.Class<? extends PersistentObject> entityClass)Delete a record from the table by id and its class type.voiddelete(java.util.List<java.lang.Long> ids, java.lang.Class<? extends PersistentObject> entityClass)Delete records from the table.voiddelete(PersistentObject entity)Delete a record from the table by given persistentObject.voiddeleteAll(java.lang.Class<? extends PersistentObject> entityClass)Delete all records belong to the given entity class from the table.voiddeleteByTenant(java.lang.Class<? extends PersistentObject> entityClass, java.util.List<FilterOption> filters)Delete all elements of a specific table for a specific tenantvoidflushStatements()voidinsert(PersistentObject entity)Add a record into the table by given persistentObject.voidinsertInBatch(java.util.List<? extends PersistentObject> entities)intupdate(java.lang.String updateQueryName)Executes a query update.intupdate(java.lang.String updateQueryName, java.util.Map<java.lang.String,java.lang.Object> inputParameters)Executes a query update.voidupdate(UpdateDescriptor desc)-
Methods inherited from interface org.bonitasoft.engine.persistence.ReadPersistenceService
getName, getNumberOfEntities, getNumberOfEntities, searchEntity, searchEntity, selectById, selectList, selectOne
-
-
-
-
Method Detail
-
insert
void insert(PersistentObject entity) throws SPersistenceException
Add a record into the table by given persistentObject.- Parameters:
entity-- Throws:
SPersistenceException- Since:
- 6.0
-
insertInBatch
void insertInBatch(java.util.List<? extends PersistentObject> entities) throws SPersistenceException
- Parameters:
entities-- Throws:
SPersistenceException
-
delete
void delete(PersistentObject entity) throws SPersistenceException
Delete a record from the table by given persistentObject.- Parameters:
entity-- Throws:
SPersistenceException- Since:
- 6.0
-
deleteAll
void deleteAll(java.lang.Class<? extends PersistentObject> entityClass) throws SPersistenceException
Delete all records belong to the given entity class from the table.- Parameters:
entityClass- The class which extends persistentObject- Throws:
SPersistenceException- Since:
- 6.0
-
update
int update(java.lang.String updateQueryName) throws SPersistenceExceptionExecutes a query update.- Parameters:
updateQueryName- the name of the declared query that represent the update.- Returns:
- the number of updated rows, as returned by the underlining persistence implementation.
- Throws:
SPersistenceException- if a persistence problem occurs when executing the update query.
-
update
int update(java.lang.String updateQueryName, java.util.Map<java.lang.String,java.lang.Object> inputParameters) throws SPersistenceExceptionExecutes a query update.- Parameters:
updateQueryName-inputParameters-- Returns:
- Throws:
SPersistenceException
-
deleteByTenant
void deleteByTenant(java.lang.Class<? extends PersistentObject> entityClass, java.util.List<FilterOption> filters) throws SPersistenceException
Delete all elements of a specific table for a specific tenant- Parameters:
entityClass- Entity class corresponding to the table to emptyfilters- Filters- Throws:
SPersistenceException- Since:
- 6.1
-
update
void update(UpdateDescriptor desc) throws SPersistenceException
- Parameters:
desc-- Throws:
SPersistenceException
-
flushStatements
void flushStatements() throws SPersistenceException- Throws:
SPersistenceException
-
delete
void delete(long id, java.lang.Class<? extends PersistentObject> entityClass) throws SPersistenceExceptionDelete a record from the table by id and its class type.- Parameters:
id- entity's identityClass- The class which extends persistentObject- Throws:
SPersistenceException- Since:
- 6.0
-
delete
void delete(java.util.List<java.lang.Long> ids, java.lang.Class<? extends PersistentObject> entityClass) throws SPersistenceExceptionDelete records from the table.- Parameters:
ids- A list contains entity idsentityClass- The class which extends persistentObject- Throws:
SPersistenceException- Since:
- 6.0
-
-