Annotation Type SQLJoinTableRestriction

  • @Target({METHOD,FIELD})
    public @interface SQLJoinTableRestriction
    Specifies a restriction written in native SQL to add to the generated SQL when querying the join table of a collection.

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

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

      Required Elements 
      Modifier and Type Required Element Description
      String value
      A predicate, written in native SQL.
    • Element Detail

      • value

        String value
        A predicate, written in native SQL.