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 Thu, 15 Jul 2010 21:41:09 GMT
>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 []
Sent: Thursday, July 15, 2010 8:19 AM
Subject: Unnecesery INNER JOIN

Let's say I have the following persistence class:

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 FROM B where = 123

my SQL output looks like:
SELECT FROM table_b t0 INNER JOIN table_a t1 ON t0.a_id = WHERE
( = 123)

Why does openJPA add unnecesery JOIN to the SQL query.
Can I somehow change this behaviour of openJPA


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