Annotation Interface Join


Specifies a join part of a query, e.g. select c from Customer c inner join c.addresses a
Author:
Tomasz Kaczmarzyk
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Specifies an alias for the joined part, e.g.
    Specifies a collection property to join on, e.g.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Hibernate since version 6.0 deduplicates results (https://github.com/hibernate/hibernate-orm/blob/6.0/migration-guide.adoc#query-sqm-distinct).
    jakarta.persistence.criteria.JoinType
     
  • Element Details

    • path

      String path
      Specifies a collection property to join on, e.g. "addresses"
    • alias

      String alias
      Specifies an alias for the joined part, e.g. "a"
    • distinct

      boolean distinct
      Hibernate since version 6.0 deduplicates results (https://github.com/hibernate/hibernate-orm/blob/6.0/migration-guide.adoc#query-sqm-distinct). For the paged and count queries the distinct should be set to true (default behaviour) in main cases. Changing distinct to false (when using Hibernate) makes sense only in count queries -- in all other cases it will lead to unexpected behaviour.
      Default:
      true
    • type

      jakarta.persistence.criteria.JoinType type
      Default:
      LEFT