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: Re: A few JPQL questions Date: Wed, 03 Feb 2016 09:28:25 +0100 Organization: Decebal Computing Lines: 27 Message-ID: <87si1akxjq.fsf@Equus.decebal.nl> References: <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="21277"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/EeQ2F5Y3fVeNN6N0hvGXNMIyDVpOBBrM=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:1XOIOOXsoGJmjT5CP0DRgaSsbEs= sha1:ZAJD10CjHKBu+OgDF711BS6VMIU= X-Homepage: http://www.decebal.nl/ Xref: csiph.com comp.lang.java.programmer:33572 On Wednesday 3 Feb 2016 08:46 CET, Cecil Westerhof wrote: > 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? I just spoke with him through instant message. He made an error regarding the conditions. So he thought he was doing the same, but he was not. This problem is solved. > 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? Probably it will turn out that here he also made a mistake. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof