openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <>
Subject Re: Unnecessary Join on bidirectional OneToOne relation
Date Mon, 17 Oct 2011 14:10:26 GMT
> which seems to be
You are correct that the JIRA is unresolved... but but it appears that some
code was committed. By looking at the unit tests, it looks like the issue
may have been resolved.

How are you mapping this relationship? Can you post code snippets from both
sides of the relationship?

On Mon, Oct 17, 2011 at 7:42 AM, Tobias Trelle <
> wrote:

> Hi,
> our DBAs detected a strange SQL statement in conjunction w/ a bidirectional
> one-to-one relationship between entities. I compiled a minimal example that
> demonstrates the case:
> When querying an entity of type A the following SQL is executed:
> The select starts at table A and performs a join to table B (fine). Then
> there's another join back to A again (strange). We are using OpenJPA 2.0.1.
> The double join happens (at least) w/ dictionairies for Derby and DB2.
> During my research, I came upon this ticket:
> which seems to be
> unresolved. Can I assume that this error still exists? Did the patch go
> into
> the 2.x versions?
> A possible workaround (using lazy loading and fetching the relationships
> with fetch join queries) is not applicable in our situation since the
> relationships are not necessarily fetched by queries.
> I am also aware that a bidirectional one-to-one relationship is not the
> best
> design, but the data is spread on two tables and some legacy COBOL
> transaction are accessing these tables. A schema change is not possible.
> Any ideas?
> TIA,
> Tobias
> --
*Rick Curtis*

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message