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(); } } }
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(); } } }
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(); } } }