From 3ef4ddd5a04b2e045c89842f9e0adf43203b842d Mon Sep 17 00:00:00 2001 From: Greg Burd Date: Thu, 12 Oct 2017 09:23:00 -0400 Subject: [PATCH] Selections from materialized views my have different entity properties that impact generated queries. Remove noisy/expensive selection of ttl and write time until we need/use it for cache correctness properties (if ever). --- .../helenus/core/operation/SelectOperation.java | 14 ++++++++------ .../core/views/MaterializedViewTest.java | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/net/helenus/core/operation/SelectOperation.java b/src/main/java/net/helenus/core/operation/SelectOperation.java index f36dc60..5444262 100644 --- a/src/main/java/net/helenus/core/operation/SelectOperation.java +++ b/src/main/java/net/helenus/core/operation/SelectOperation.java @@ -133,12 +133,12 @@ public final class SelectOperation extends AbstractFilterStreamOperation from(String alternateTableName) { - this.alternateTableName = alternateTableName; + this.props.clear(); + entity + .getOrderedProperties() + .stream() + .map(p -> new HelenusPropertyNode(p, Optional.empty())) + .forEach(p -> this.props.add(p)); return this; } @@ -243,6 +243,7 @@ public final class SelectOperation extends AbstractFilterStreamOperation extends AbstractFilterStreamOperationfrom(CyclistsByAge.class) + .from(CyclistsByAge.class) .where(cyclist::age, eq(18)) .sync(); }