dao: Hit the cache for entity flagged as removed too since they are put

in cache afterwards.
This commit is contained in:
Marc-Aurèle Brothier 2016-05-04 14:28:44 +02:00
parent 5251eeddf2
commit 696440a675
1 changed files with 6 additions and 1 deletions

View File

@ -969,7 +969,12 @@ public abstract class GenericDaoBase<T, ID extends Serializable> extends Compone
@Override
@DB()
public T findByIdIncludingRemoved(ID id) {
return findById(id, true, null);
if (_cache != null) {
final Element element = _cache.get(id);
return element == null ? findById(id, true, null) : (T)element.getObjectValue();
} else {
return findById(id, true, null);
}
}
@Override