openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell Collins <>
Subject RE: Unnecesery INNER JOIN
Date Fri, 16 Jul 2010 14:08:02 GMT
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 []
Sent: Friday, July 16, 2010 12:52 AM
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 = 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:
Sent from the OpenJPA Users mailing list archive at

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.

View raw message