From 0b86d33725b4d59e0cd97c61fcaefcb10e6602c4 Mon Sep 17 00:00:00 2001 From: Greg Burd Date: Fri, 3 Nov 2017 08:49:31 -0400 Subject: [PATCH] Change ALLOW FILTERING logic and session cache merge a bit. --- src/main/java/net/helenus/core/AbstractUnitOfWork.java | 2 +- src/main/java/net/helenus/core/HelenusSession.java | 7 +++++-- .../java/net/helenus/core/operation/SelectOperation.java | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/helenus/core/AbstractUnitOfWork.java b/src/main/java/net/helenus/core/AbstractUnitOfWork.java index f658956..31e7b0c 100644 --- a/src/main/java/net/helenus/core/AbstractUnitOfWork.java +++ b/src/main/java/net/helenus/core/AbstractUnitOfWork.java @@ -369,7 +369,7 @@ public abstract class AbstractUnitOfWork columnMap.forEach( (columnKey, value) -> { if (to.contains(rowKey, columnKey)) { - // TODO(gburd):... + // TODO(gburd): merge case, preserve object identity to.put( rowKey, columnKey, diff --git a/src/main/java/net/helenus/core/HelenusSession.java b/src/main/java/net/helenus/core/HelenusSession.java index 7661f54..aeee3c8 100644 --- a/src/main/java/net/helenus/core/HelenusSession.java +++ b/src/main/java/net/helenus/core/HelenusSession.java @@ -317,8 +317,11 @@ public class HelenusSession extends AbstractSessionOperations implements Closeab Object pojo, String tableName, List facetCombinations) { for (String[] combination : facetCombinations) { String cacheKey = tableName + "." + Arrays.toString(combination); - sessionCache.invalidate(cacheKey); - sessionCache.put(cacheKey, pojo); + if (pojo == null || pojo == HelenusSession.deleted) { + sessionCache.invalidate(cacheKey); + } else { + sessionCache.put(cacheKey, pojo); + } } } diff --git a/src/main/java/net/helenus/core/operation/SelectOperation.java b/src/main/java/net/helenus/core/operation/SelectOperation.java index b70c595..6ed34f1 100644 --- a/src/main/java/net/helenus/core/operation/SelectOperation.java +++ b/src/main/java/net/helenus/core/operation/SelectOperation.java @@ -312,8 +312,8 @@ public final class SelectOperation extends AbstractFilterStreamOperation