@Test @DisplayName("fail if the query does not specify filters and `include_all` is not set") void failOnInvalidQuery() { Target target = Target .newBuilder() .setType(TypeName.of(Mirror.class).value()) .buildPartial(); Query query = Query .newBuilder() .setId(QueryId.newBuilder().setValue(newUuid())) .setContext(factory.newActorContext()) .setTarget(target) .buildPartial(); assertThrows(ValidationException.class, () -> processor.process(query)); }
@Override public ImmutableCollection<EntityStateWithVersion> process(Query query) { Iterator<EntityRecord> entities = query.all() ? loadAll(query.responseFormat()) : loadByQuery(query); ImmutableList<EntityStateWithVersion> result = stream(entities) .map(EntityQueryProcessor::toEntityState) .collect(toImmutableList()); return result; }
EntityQueryProcessor implements QueryProcessor { @Override public ImmutableCollection<EntityStateWithVersion> process(Query query) { Iterator<EntityRecord> entities = query.all() ? loadAll(query.responseFormat()) : loadByQuery(query); ImmutableList<EntityStateWithVersion> result = stream(entities) .map(EntityQueryProcessor::toEntityState) .collect(toImmutableList()); return result; } }
EntityQueryProcessor implements QueryProcessor { @Override public ImmutableCollection<EntityStateWithVersion> process(Query query) { Iterator<EntityRecord> entities = query.all() ? loadAll(query.responseFormat()) : loadByQuery(query); ImmutableList<EntityStateWithVersion> result = stream(entities) .map(EntityQueryProcessor::toEntityState) .collect(toImmutableList()); return result; } EntityQueryProcessor(
            RecordBasedRepository<?, ? extends Entity, ? extends EntityState> repository); }
EntityQueryProcessor implements QueryProcessor { @Override public ImmutableCollection<EntityStateWithVersion> process(Query query) { Iterator<EntityRecord> entities = query.all() ? loadAll(query.responseFormat()) : loadByQuery(query); ImmutableList<EntityStateWithVersion> result = stream(entities) .map(EntityQueryProcessor::toEntityState) .collect(toImmutableList()); return result; } EntityQueryProcessor(
            RecordBasedRepository<?, ? extends Entity, ? extends EntityState> repository); @Override ImmutableCollection<EntityStateWithVersion> process(Query query); }
EntityQueryProcessor implements QueryProcessor { @Override public ImmutableCollection<EntityStateWithVersion> process(Query query) { Iterator<EntityRecord> entities = query.all() ? loadAll(query.responseFormat()) : loadByQuery(query); ImmutableList<EntityStateWithVersion> result = stream(entities) .map(EntityQueryProcessor::toEntityState) .collect(toImmutableList()); return result; } EntityQueryProcessor(
            RecordBasedRepository<?, ? extends Entity, ? extends EntityState> repository); @Override ImmutableCollection<EntityStateWithVersion> process(Query query);  }