Annotation Type Where


Add an Literal to add to the where clause when a many property (List, Set or Map) is loaded or refreshed.


 // on a OneToMany property...

 @OneToMany
 @Where(clause = "deleted='y'")
 List<Topic> topics;

 

Note that you can include "${ta}" as a place holder for the table alias if you need to include the table alias in the clause.


 // ... including the ${ta} table alias placeholder...

 @OneToMany
 @Where(clause = "${ta}.deleted='y'")
 List<Topic> topics;

 

This will be added to the where clause when lazy loading the OneToMany property or when there is a join to that OneToMany property.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static @interface 
    Repeatable support for Where.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The clause added to the lazy load query.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The platform where this annotation is active.
  • Element Details

    • clause

      String clause
      The clause added to the lazy load query.

      Note that you can include "${ta}" as a place holder for the table alias if you need to include the table alias in the clause.

    • platforms

      Platform[] platforms
      The platform where this annotation is active. Default: any platform
      Default:
      {}