deltaspike-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matti Tahvonen <ma...@vaadin.com>
Subject Using QueryResult as return type without predicate
Date Wed, 15 Mar 2017 11:12:12 GMT
Hi,

My colleague is preparing an example for Vaadin 8 that uses DeltaSpike Data (as per my suggestion).
We had a hard time finding a solution where you could return QueryResult form a JPA Repository,
without having any predicates. We want to use QueryResult as it is easy to do sorting and
paging using it, but just want to get all results from the database. In other words we’d
need an alternative to findAll that returns QueryResult.

The workaround was to add a dummy predicate, but that’s not too pretty:
https://github.com/alejandro-du/lazy-loading-cdi-demo/blob/master/src/main/java/com/example/PersonService.java#L23

QueryResult  findBy() or QueryResult findAllBy() don’t seem to work. Any ideas how this
should be tackled?

__
Matti Tahvonen – +358 44 3029728 – Vaadin Ltd - vaadin.com





Mime
View raw message