• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate second query

 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,



If we have the following references (eager):

A ->B ->C ->D

Hibernate will generate one query with �left outer join� for all hierarchies of each reference. The result is a �crazy query� that cause to oracle to crash.

I wonder if there is a configuration to hibernate to fetch A with all the references, but in few steps and not in one �crazy query�.

I think that toplink has such a configuration to break the query to pieces.

Do you know if hibernate has this feature?

Thank you
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you tell us a bit more about your associations and your query code (using Hibernate)?
 
avihai marchiano
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Class A has OneToOne to class B,
Class B has OneToOne to class C,
Class C has OneToOne to class D.

from class B inherit B1,B2,B3,B4
from class C inherit C1,C2,C3,C4
from class D inherit D1,D2,D3,D4

The relations are eager , because when i load i need b,c,d.

the probelm is that hiebrnate will generate one query to load A.
it will be with a lot of left outer joins.
left outer join for any class in B,C,D hierarchy.

left outer join B , left outer join B1 , left outer join B2 ...

a query with a lot of joins cause to oracle to crash.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic