When both sides of a relationhship are EAGER this should result in
only one join (not two).
Account <-> Holidng is One Account has Many holdings. Both roles of
the relationship are marked EAGER.
If I join
Account t0 join Holding t1 on(t1.account=t0.accountId)
there should not be a need to do
Regardless the ManyToOne is EAGER by default, when its
inverse relationship if
1. set to EAGER (select a from a a; a has the OneToManyRelation property)
or
2. set to LAZY but Eagerly Fetched by query (select ... from a a join fetch
a.OneToManyRelation )
We see unneeded joins being generated.
T
I've looked at the code and it looks correct to me and tried various
things like making the inverse LAZY.But it always generating the
extraneous join. I've attached the entity source code.
The relationship causing problem is
@ManyToOne
@JoinColumn(name="ACCOUNT_ACCOUNTID")
private
I've looked at the code and it looks correct to me and tried various
things like making the inverse LAZY.But it always generating the
extraneous join. I've attached the entity source code.
The relationship causing problem is
@ManyToOne
@JoinColumn(name="ACCOUNT_ACCOUNTID")
private
What if just one side is eager? Also, is the @OneToMany's mappedBy
attribute set up correctly?
-Patrick
--
Patrick Linskey
BEA Systems, Inc.
___
Notice: This email message, together with any attachments, may contain
informati