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).
This commit is contained in:
parent
4e461c1be0
commit
3ef4ddd5a0
2 changed files with 9 additions and 7 deletions
|
@ -133,12 +133,12 @@ public final class SelectOperation<E> extends AbstractFilterStreamOperation<E, S
|
|||
Objects.requireNonNull(materializedViewClass);
|
||||
HelenusEntity entity = Helenus.entity(materializedViewClass);
|
||||
this.alternateTableName = entity.getName().toCql();
|
||||
this.allowFiltering = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SelectOperation<E> 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<E> extends AbstractFilterStreamOperation<E, S
|
|||
+ prop.getEntity().getMappingInterface());
|
||||
}
|
||||
|
||||
/* TODO: is this useful information to gather when caching?
|
||||
if (cached) {
|
||||
switch (prop.getProperty().getColumnType()) {
|
||||
case PARTITION_KEY:
|
||||
|
@ -261,6 +262,7 @@ public final class SelectOperation<E> extends AbstractFilterStreamOperation<E, S
|
|||
break;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
if (entity == null) {
|
||||
|
|
|
@ -70,7 +70,7 @@ public class MaterializedViewTest extends AbstractEmbeddedCassandraTest {
|
|||
public void testMv() throws Exception {
|
||||
session
|
||||
.select(Cyclist.class)
|
||||
.<CyclistsByAge>from(CyclistsByAge.class)
|
||||
.from(CyclistsByAge.class)
|
||||
.where(cyclist::age, eq(18))
|
||||
.sync();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue