File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes Unnecessary INNER JOIN with Criteria Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Unnecessary INNER JOIN with Criteria" Watch "Unnecessary INNER JOIN with Criteria" New topic

Unnecessary INNER JOIN with Criteria

Darlan Moraes

Joined: Jan 08, 2013
Posts: 7

I'm working on a method in which a given table needs to join with another and with a field of the second table still another comparison do with it. Something like:

The method is as follows:

And the only mapping that exists is unidirectional, from Subs to Auth:

This works, but OpenJPA does the following:

Does anyone know how to avoid this second join?
I agree. Here's the link:
subject: Unnecessary INNER JOIN with Criteria
It's not a secret anymore!