Skip to content

Commit 4c94ee7

Browse files
committed
add a code example of @filter applied to a one-to-many
1 parent 0189680 commit 4c94ee7

File tree

1 file changed

+10
-0
lines changed
  • hibernate-core/src/main/java/org/hibernate/annotations

1 file changed

+10
-0
lines changed

hibernate-core/src/main/java/org/hibernate/annotations/Filter.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@
3333
* }
3434
* </pre>
3535
* <p>
36+
* Similarly, the filter could be applied to a one-to-many association
37+
* like this:
38+
* <pre>
39+
* &#64;OneToMany(mappedBy = "provider")
40+
* &#64;Filter(name = "Current",
41+
* deduceAliasInjectionPoints = false,
42+
* condition = "{alias}.year = extract(year from current_date)")
43+
* List&lt;Course&gt; courses;
44+
* </pre>
45+
* <p>
3646
* If an entity or collection has no {@code @Filter} annotation
3747
* with the name of a given filter, it is not affected by that
3848
* filter.

0 commit comments

Comments
 (0)