Hi, This sounds like it might be another manifestation of https://issues.apache.org/jira/browse/OPENJPA-1711
-Patrick On Jul 15, 2010, at 2:41 PM, Russell Collins wrote: > From the looks of what you have in your query, there has to be a join of some > kind. You are trying to get the "id" of class "A" that is associated with > class "B". If this is not your desire, what are you trying to do? > > -----Original Message----- > From: QkI [mailto:[email protected]] > Sent: Thursday, July 15, 2010 8:19 AM > To: [email protected] > Subject: Unnecesery INNER JOIN > > > Hi, > Let's say I have the following persistence class: > > @Entity > public class B { > > @OneToOne(cascade = CascadeType.PERSIST, fetch = FetchType.LAZY) > @JoinColumn(name = "a_id") > private A a; > } > > and when I try to execute this JPA query: > SELECT b.a.id FROM B where B.id = 123 > > my SQL output looks like: > SELECT t1.id FROM table_b t0 INNER JOIN table_a t1 ON t0.a_id = t1.id WHERE > (t0.id = 123) > > Why does openJPA add unnecesery JOIN to the SQL query. > Can I somehow change this behaviour of openJPA > > Thanks, > QkI > > > -- > View this message in context: > http://openjpa.208410.n2.nabble.com/Unnecesery-INNER-JOIN-tp5297321p5297321.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. > > CONFIDENTIALITY NOTICE: The information contained in this electronic mail > (email) transmission (including attachments), is intended by MCLANE ADVANCED > TECHNOLOGIES for the use of the named individual or entity to which it is > addressed and may contain information that is privileged, confidential and/or > protected as a trade secret. It is not intended for transmission to, or > receipt by, any individual or entity other than the named addressee(s). If > you have received this email in error, please delete it (including > attachments) and any copies thereof without printing, copying or forwarding > it, and notify the sender of the error by email reply immediately. -- Patrick Linskey 202 669 5907
