public abstract class AbstractDataManager<EntityImpl extends Entity> extends Object implements DataManager<EntityImpl>
| Constructor and Description |
|---|
AbstractDataManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
bulkDelete(String statement,
CachedEntityMatcher<EntityImpl> cachedEntityMatcher,
Object parameter)
Does a bulk delete, but also uses the provided
CachedEntityMatcher
to look in the cache to mark the cached entities as deleted. |
void |
delete(EntityImpl entity) |
void |
delete(String id) |
protected void |
deleteCachedEntities(DbSqlSession dbSqlSession,
CachedEntityMatcher<EntityImpl> cachedEntityMatcher,
Object parameter) |
protected void |
deleteCachedEntities(DbSqlSession dbSqlSession,
Collection<CachedEntity> cachedObjects,
CachedEntityMatcher<EntityImpl> cachedEntityMatcher,
Object parameter) |
EntityImpl |
findById(String entityId) |
protected EntityImpl |
findByQuery(String selectQuery,
Object parameter) |
protected CommandContext |
getCommandContext() |
protected DbSqlSession |
getDbSqlSession() |
protected EntityImpl |
getEntity(String selectQuery,
Object parameter,
SingleCachedEntityMatcher<EntityImpl> cachedEntityMatcher,
boolean checkDatabase) |
protected EntityCache |
getEntityCache() |
protected List<EntityImpl> |
getList(DbSqlSession dbSqlSession,
String dbQueryName,
Object parameter,
CachedEntityMatcher<EntityImpl> cachedEntityMatcher,
boolean checkCache) |
protected List<EntityImpl> |
getList(String dbQueryName,
Object parameter) |
protected List<EntityImpl> |
getList(String dbQueryName,
Object parameter,
CachedEntityMatcher<EntityImpl> cachedEntityMatcher) |
protected List<EntityImpl> |
getList(String dbQueryName,
Object parameter,
CachedEntityMatcher<EntityImpl> cachedEntityMatcher,
boolean checkCache)
Gets a list by querying the database and the cache using
CachedEntityMatcher. |
protected List<EntityImpl> |
getListFromCache(CachedEntityMatcher<EntityImpl> entityMatcher,
Object parameter) |
protected List<EntityImpl> |
getListFromCache(CachedEntityMatcher<EntityImpl> entityMatcher,
Object parameter,
boolean includeDeletedEntities) |
abstract Class<? extends EntityImpl> |
getManagedEntityClass() |
List<Class<? extends EntityImpl>> |
getManagedEntitySubClasses() |
protected <T> T |
getSession(Class<T> sessionClass) |
void |
insert(EntityImpl entity) |
protected boolean |
isEntityInserted(DbSqlSession dbSqlSession,
String entityLogicalName,
String entityId) |
EntityImpl |
update(EntityImpl entity) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreatepublic abstract Class<? extends EntityImpl> getManagedEntityClass()
public List<Class<? extends EntityImpl>> getManagedEntitySubClasses()
protected CommandContext getCommandContext()
protected <T> T getSession(Class<T> sessionClass)
protected DbSqlSession getDbSqlSession()
protected EntityCache getEntityCache()
public EntityImpl findById(String entityId)
findById in interface DataManager<EntityImpl extends Entity>public void insert(EntityImpl entity)
insert in interface DataManager<EntityImpl extends Entity>public EntityImpl update(EntityImpl entity)
update in interface DataManager<EntityImpl extends Entity>public void delete(String id)
delete in interface DataManager<EntityImpl extends Entity>public void delete(EntityImpl entity)
delete in interface DataManager<EntityImpl extends Entity>protected EntityImpl findByQuery(String selectQuery, Object parameter)
protected List<EntityImpl> getList(String dbQueryName, Object parameter)
protected EntityImpl getEntity(String selectQuery, Object parameter, SingleCachedEntityMatcher<EntityImpl> cachedEntityMatcher, boolean checkDatabase)
protected List<EntityImpl> getList(String dbQueryName, Object parameter, CachedEntityMatcher<EntityImpl> cachedEntityMatcher)
protected List<EntityImpl> getList(String dbQueryName, Object parameter, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, boolean checkCache)
CachedEntityMatcher. First, the entities are fetched from the database using the provided query. The cache is then queried for
the entities of the same type. If an entity matches the CachedEntityMatcher condition, it replaces the entity from the database (as it is newer).dbQueryName - The query name that needs to be executed.parameter - The parameters for the query.cachedEntityMatcher - The matcher used to determine which entities from the cache needs to be retainedcheckCache - If false, no cache check will be done, and the returned list will simply be the list from the database.protected List<EntityImpl> getList(DbSqlSession dbSqlSession, String dbQueryName, Object parameter, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, boolean checkCache)
protected List<EntityImpl> getListFromCache(CachedEntityMatcher<EntityImpl> entityMatcher, Object parameter)
protected List<EntityImpl> getListFromCache(CachedEntityMatcher<EntityImpl> entityMatcher, Object parameter, boolean includeDeletedEntities)
public void bulkDelete(String statement, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, Object parameter)
CachedEntityMatcher
to look in the cache to mark the cached entities as deleted.
(This is necessary if entities are inserted and deleted in the same operation).protected void deleteCachedEntities(DbSqlSession dbSqlSession, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, Object parameter)
protected void deleteCachedEntities(DbSqlSession dbSqlSession, Collection<CachedEntity> cachedObjects, CachedEntityMatcher<EntityImpl> cachedEntityMatcher, Object parameter)
protected boolean isEntityInserted(DbSqlSession dbSqlSession, String entityLogicalName, String entityId)
Copyright © 2019 Flowable. All rights reserved.