@Test @DisplayName("read all entities") void readAll() { Query query = queries.all(Menu.class); ImmutableCollection<EntityStateWithVersion> records = processor.process(query); assertThat(records).hasSize(MENU_COUNT); }
@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);  }