Skip to content

Commit 92db11f

Browse files
committed
HHH-19555 improve javadoc for SQLRestriction
1 parent d2f510b commit 92db11f

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,21 @@
3737
* List<Document> documents;
3838
* </pre>
3939
* <p>
40+
* If a restriction declared by an entity should be applied to a to-one
41+
* association to that entity type, the association should be mapped to
42+
* an {@linkplain jakarta.persistence.JoinTable association table}.
43+
* <pre>
44+
* &#64;ManyToOne
45+
* &#64;JoinTable(name = "application_document")
46+
* Document document;
47+
* </pre>
48+
* The {@code SQLRestriction} annotation may not be directly applied to
49+
* a field or property annotated {@link jakarta.persistence.OneToOne} or
50+
* {@link jakarta.persistence.ManyToOne}, and restrictions on foreign
51+
* key associations are dangerous.
52+
* <p>
4053
* The {@link SQLJoinTableRestriction} annotation lets a restriction be
41-
* applied to an {@linkplain jakarta.persistence.JoinTable association table}:
54+
* applied to the columns of an association table:
4255
* <pre>
4356
* &#64;ManyToMany
4457
* &#64;JoinTable(name = "collaborations")

0 commit comments

Comments
 (0)