Search in sources :

Example 1 with DbEntityLifecycleAware

use of org.camunda.bpm.engine.impl.db.DbEntityLifecycleAware in project camunda-bpm-platform by camunda.

the class DbEntityManager method onEntityLoaded.

public void onEntityLoaded(DbEntity entity) {
    // we get a callback when the persistence session loads an object from the database
    DbEntity cachedPersistentObject = dbEntityCache.get(entity.getClass(), entity.getId());
    if (cachedPersistentObject == null) {
        // only put into the cache if not already present
        dbEntityCache.putPersistent(entity);
        // invoke postLoad() lifecycle method
        if (entity instanceof DbEntityLifecycleAware) {
            DbEntityLifecycleAware lifecycleAware = (DbEntityLifecycleAware) entity;
            lifecycleAware.postLoad();
        }
    }
}
Also used : DbEntity(org.camunda.bpm.engine.impl.db.DbEntity) CachedDbEntity(org.camunda.bpm.engine.impl.db.entitymanager.cache.CachedDbEntity) DbEntityLifecycleAware(org.camunda.bpm.engine.impl.db.DbEntityLifecycleAware)

Aggregations

DbEntity (org.camunda.bpm.engine.impl.db.DbEntity)1 DbEntityLifecycleAware (org.camunda.bpm.engine.impl.db.DbEntityLifecycleAware)1 CachedDbEntity (org.camunda.bpm.engine.impl.db.entitymanager.cache.CachedDbEntity)1