Annotation Type Where


  • @Target({TYPE,METHOD,FIELD})
    @Retention(RUNTIME)
    public @interface Where
    Specifies a restriction written in native SQL to add to the generated SQL when querying an entity or collection.

    For example, @Where("deleted = false") could be used to hide entity instances which have been soft-deleted.

    Note that Where restrictions are always applied and cannot be disabled. They're therefore much less flexible than filters.

    See Also:
    Filter, DialectOverride.Where
    • Required Element Summary

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

      • clause

        String clause
        A predicate, written in native SQL.