Is possible to select data in JPA with grouping by referenced entity?
I mean: I have two entities - insurance and referenced many-to-one vehicle. Insurance entity has va
Please explicitly use JOIN in this use case:
SELECT ve, MAX(v.validTill) FROM TraInsurance v JOIN v.vehicle ve GROUP BY ve ORDER BY MAX(v.validTill)