openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Minor <>
Subject SQL generation for OneToMany object graph
Date Tue, 30 Jun 2009 00:23:25 GMT

If I have a deep object graph with a root element that has OneToMany
relationships with other elements, and those have OneToMany
relationships (and so on), and all the objects are included via a
fetch group, how does openjpa decide how to generate the SQL for a
statement like:

"SELECT r FROM RootElement r WHERE r.uid IN (:list)"

Looking at the SQL logging (this is using mysql BTW), the initial
statements use an OR to select among rows in the root element's table,
and some of the other initial tables, but then it seems to start
issuing individual SELECT statements as it gets deeper into the graph.
Is there any way to make it use OR combined with JOIN statements


David Minor

View raw message