public String next() { return iterator.next().getId(); } });
public void makeCopy() { copy = dbEntity.getPersistentState(); }
public String next() { return iterator.next().getId(); } });
public void makeCopy() { copy = dbEntity.getPersistentState(); }
public String toString() { return entityState + " " + dbEntity.getClass().getSimpleName() + "["+dbEntity.getId()+"]"; }
/** * Allows checking whether this entity is dirty. * @return true if the entity is dirty (state has changed since it was put into the cache) */ public boolean isDirty() { return !dbEntity.getPersistentState().equals(copy); }
public String toString() { return entityState + " " + dbEntity.getClass().getSimpleName() + "["+dbEntity.getId()+"]"; }
/** * Allows checking whether this entity is dirty. * @return true if the entity is dirty (state has changed since it was put into the cache) */ public boolean isDirty() { return !dbEntity.getPersistentState().equals(copy); }
/** * Looks up an entity in the cache. * @param dbEntity the entity for which the CachedEntity should be looked up * @return the cached entity or null if the entity does not exist. */ public CachedDbEntity getCachedEntity(DbEntity dbEntity) { return getCachedEntity(dbEntity.getClass(), dbEntity.getId()); }
public void makeCopy() { copy = dbEntity.getPersistentState(); }
/** * Looks up an entity in the cache. * @param dbEntity the entity for which the CachedEntity should be looked up * @return the cached entity or null if the entity does not exist. */ public CachedDbEntity getCachedEntity(DbEntity dbEntity) { return getCachedEntity(dbEntity.getClass(), dbEntity.getId()); }
/** * Allows checking whether this entity is dirty. * @return true if the entity is dirty (state has changed since it was put into the cache) */ public boolean isDirty() { return !dbEntity.getPersistentState().equals(copy); }
/** returns the object in the cache. if this object was loaded before, * then the original object is returned. */ protected DbEntity cacheFilter(DbEntity persistentObject) { DbEntity cachedPersistentObject = dbEntityCache.get(persistentObject.getClass(), persistentObject.getId()); if (cachedPersistentObject!=null) { return cachedPersistentObject; } else { return persistentObject; } }
/** returns the object in the cache. if this object was loaded before, * then the original object is returned. */ protected DbEntity cacheFilter(DbEntity persistentObject) { DbEntity cachedPersistentObject = dbEntityCache.get(persistentObject.getClass(), persistentObject.getId()); if (cachedPersistentObject!=null) { return cachedPersistentObject; } else { return persistentObject; } }
protected void validateId(DbEntity dbEntity) { EnsureUtil.ensureValidIndividualResourceId("Entity " + dbEntity + " has an invalid id", dbEntity.getId()); }
/** * Remove an entity from the cache * @param e the entity to remove * @return */ public boolean remove(DbEntity e) { Class<?> cacheKey = cacheKeyMapping.getEntityCacheKey(e.getClass()); Map<String, CachedDbEntity> typeMap = cachedEntites.get(cacheKey); if(typeMap != null) { return typeMap.remove(e.getId()) != null; } else { return false; } }
protected void validateId(DbEntity dbEntity) { EnsureUtil.ensureValidIndividualResourceId("Entity " + dbEntity + " has an invalid id", dbEntity.getId()); }