@Target(value={FIELD,METHOD,TYPE}) @Retention(value=RUNTIME) public @interface Where
// 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.
Copyright © 2016. All rights reserved.