user2040500
user2040500

Reputation:

Joins supported by Hibernate Query Language (HQL)

i'm new to Hibernate framework, basically i've experience in using joins in mysql. But does'nt know whether all the joins supported by other databases will support in hql.

can anyone please tell me which all joins are there in hibernate from the following below joins.

  1. INNER JOIN
  2. LEFT JOIN
  3. RIGHT JOIN
  4. OUTER JOIN
  5. FULL JOIN
  6. FULL OUTER JOIN
  7. LEFT OUTER JOIN
  8. RIGHT OUTER JOIN
  9. CROSS JOIN
  10. LEFT JOIN EXCLUDING INNER JOIN
  11. RIGHT JOIN EXCLUDING INNER JOIN
  12. OUTER JOIN EXCLUDING INNER JOIN

Upvotes: 1

Views: 3511

Answers (1)

Radim Köhler
Radim Köhler

Reputation: 123861

The best starting point would be the documentation. In the section 16.3. Associations and joins, we can see, that for querying, based on HQL we have:

The supported join types are borrowed from ANSI SQL:

  • inner join
  • left outer join
  • right outer join
  • full join (not usually useful)

And that's pretty it. Because we are working on the abstractinal model, all the 'specific' JOIN types defined by DB providers are not supported

Also you can check the Criterion here, to see predefined joins 'const': FULL_JOIN, INNER_JOIN, LEFT_JOIN, used for Criteria API *(e.g. Criteria.LEFT_JOIN)*

Upvotes: 1

Related Questions