I guess what I am saying is that this join is necessary.  In standard SQL the 
only way you are going to get relational data from two tables is by joining the 
tables or performing nested selects.  I think  the thing you want to do is to 
just look for the column on table "B" that corresponds to the id column of 
table "A" (Foreign Key).   If this is what you are trying to do, then you need 
to run a select on that foreign key column on table "B" and not try to bring 
back the entire "A" record.

-----Original Message-----
From: QkI [mailto:kukis...@gmail.com]
Sent: Friday, July 16, 2010 12:52 AM
To: users@openjpa.apache.org
Subject: RE: Unnecesery INNER JOIN


>From my point of view, there shouldn't be any joins and correct SQL output
should look like:
SELECT b.a_id FROM table_b b WHERE b.id = 123

I try to limit unnecesery joins in my queries, because in the case of
pessimistic locking this behavoiur locks too much.

By the way previously I was using hibernate and this framework doesn't add
unnecesery joins.


--
View this message in context: 
http://openjpa.208410.n2.nabble.com/Unnecesery-INNER-JOIN-tp5297321p5300566.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.

Reply via email to