Package org.hibernate.annotations

Annotation Type WhereJoinTable


  • @Target({METHOD,FIELD})@Retention(RUNTIME)@Deprecated(since="6.3")public @interfaceWhereJoinTable
    Specifies a restriction written in native SQL to add to the generated SQL when querying thejoin table of a collection.

    For example,@WhereJoinTable("status <> 'DELETED'") could be used to hide associations which have been soft-deleted from an association table.

    See Also:
    Where
    API Note:
    This separate annotation is useful because it's possible to filter a many-to-many associationboth by a restriction on the join table, and,simultaneously, by a restriction on the associated entity table. The@Where annotation always filters entity tables.
    • Required Element Summary

      Required Elements 
      Modifier and TypeRequired ElementDescription
      Stringclause
      Deprecated.
      A predicate, written in native SQL.
    • Element Detail

      • clause

        String clause
        Deprecated.
        A predicate, written in native SQL.