0

I am using the findAll passing Example and Pageable.. How can I use IN clause? for example in a Class I have a property location. i want to pass 2 location as parameters.

Thanks.

Here is the findAll im using:

public <S extends T> Page<S> findAll(Example<S> example, Pageable pageable) {
    SimpleJpaRepository.ExampleSpecification<S> spec = new SimpleJpaRepository.ExampleSpecification(example);
    Class<S> probeType = example.getProbeType();
    TypedQuery<S> query = this.getQuery(new SimpleJpaRepository.ExampleSpecification(example), probeType, (Pageable)pageable);
    return (Page)(pageable == null ? new PageImpl(query.getResultList()) : this.readPage(query, probeType, pageable, spec));
}
Joseph Move
  • 69
  • 1
  • 9
  • Please see if https://stackoverflow.com/questions/18987292/spring-crudrepository-findbyinventoryidslistlong-inventoryidlist-equivalen is hepful to you – Ian Lim Dec 13 '18 at 06:37
  • 1
    Possible duplicate of [Query by Example Spring Data - In Clause?](https://stackoverflow.com/questions/48528066/query-by-example-spring-data-in-clause) – Jens Schauder Dec 13 '18 at 07:33

0 Answers0