Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Cecil Westerhof Newsgroups: comp.lang.java.programmer Subject: JPQL: JOIN on the max value of a list Date: Wed, 17 Feb 2016 04:51:56 +0100 Organization: Decebal Computing Lines: 17 Message-ID: <87twl8804j.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="12baf5125b19322b899c79c2e3878015"; logging-data="5429"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+MWKv+W/0rD05VS/kU0TTE6AlXphSjASU=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Homepage: http://www.decebal.nl/ Cancel-Lock: sha1:vk5brfQwWjx6d2MYl2s6j3HaLhY= sha1:bpmh3PJRaoxmjXbeQOW5i6JsvhE= Xref: csiph.com comp.lang.java.programmer:33844 I am trying something in the lines of: SELECT inst FROM instelling inst JOIN FETCH inst.aanvragen JOIN FETCH inst.aanvragen.beoordelingen But the problem is that the field aanvragen is a list. So I get: JPQL does not allow traversal through multi-valued relation path. Try join instead. I would like the JOIN to take place on the max value of aanvragen. Is this possible? If so: how? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof