using JPA 2.1 and hibernate 5.1.x, this is possible with JPQL
select s.lowerBound,
l.status
...
from Serie s
left join Line l on
s.lowerBound between l.lineStart and l.lineEnd
how do i write this using api criterion? i tried this
Root<Serie> serieRoot = query.from(Serie.class);
Root<Line> lineRoot query.from(Line.class);
query.where(criteriaBuilder.between(s.get("lowerBound"), l.get("lineStart"), s.get("lineEnd")))
but this does not allow me to indicate its left join.
source
share