0

我正在使用 findAll 传递 Example 和 Pageable.. 如何使用 IN 子句?例如在一个类中,我有一个属性位置。我想将 2 个位置作为参数传递。

谢谢。

这是我使用的 findAll:

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));
}
4

0 回答 0