Path: csiph.com!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Cecil Westerhof Newsgroups: comp.lang.java.programmer Subject: A few JPQL questions Date: Wed, 03 Feb 2016 08:46:52 +0100 Organization: Decebal Computing Lines: 20 Message-ID: <871t8ume1f.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="12baf5125b19322b899c79c2e3878015"; logging-data="13203"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/AFuFU0Nri97jx2SgSjQZzR4cLgcD/chg=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Homepage: http://www.decebal.nl/ Cancel-Lock: sha1:UfJWqClH4BPav6RotRM8nP9vTlk= sha1:YqseMwabkdEdfNrQjbSUS+JI1/s= Xref: csiph.com comp.lang.java.programmer:33571 I do not have very much experience with JPA and especially with JPQL. Yesterday shortly before leaving my colleague told me that he could not use an embedded key in JPQL. He told me that when he used something like: a.id = b.id he got more records as when he used: a.id.first = b.id.first AND a.id.second = b.id.second … I had not the time to evaluate this, but it seems very strange to me. Could this be true? If so, what would be the reason? Otherwise, which mistake has he likely made? He also told me it was not possible to do a JOIN on a sub-query in JPQL. He said it is only possible to use WHERE and HAVING. I assume he made a mistake. What is most likely he did wrong? -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof