Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Forcing JPA to create cross-table queries?

jwentingAug 2 2009 — edited Aug 10 2009
I've several entities that (except that one class, I did prevent that circular dependency) each have a dependency on at least one other class.

For example a Category has a Memo.
Is there any way to get JPA to generate SQL like
select c.id, c.description, m.id, m.text from category c, memo m where m.id = c.memo_id
rather than the far less efficient (in database round tripping and query execution time)
select id, description, memo_id deom category
followed by
select id, text from memo where id = ?1
for each returned record from the first query?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 7 2009
Added on Aug 2 2009
12 comments
1,187 views