Skip to content

Commit 93a589d

Browse files
committed
HHH-19508 improve jdoc of hibernate.order_updates and hibernate.order_inserts
1 parent 7b43dda commit 93a589d

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

hibernate-core/src/main/java/org/hibernate/cfg/BatchSettings.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,13 @@ public interface BatchSettings {
3636
String STATEMENT_BATCH_SIZE = "hibernate.jdbc.batch_size";
3737

3838
/**
39-
* Enable ordering of update statements by primary key value, for the purpose of more
40-
* efficient JDBC batching
39+
* Enable ordering of entity update statements by entity type and primary
40+
* key value, and of statements relating to collection modification by
41+
* collection role and foreign key value, for the purpose of more efficient
42+
* JDBC batching.
43+
* <p>
44+
* The sort order also reduces the change of a unique key violation when
45+
* a collection element is moved from one parent to a different parent.
4146
*
4247
* @see org.hibernate.boot.SessionFactoryBuilder#applyOrderingOfUpdates
4348
*
@@ -46,8 +51,11 @@ public interface BatchSettings {
4651
String ORDER_UPDATES = "hibernate.order_updates";
4752

4853
/**
49-
* Enable ordering of insert statements by primary key value, for the purpose of more
50-
* efficient JDBC batching.
54+
* Enable ordering of entity insert statements by entity type and primary
55+
* key value, for the purpose of more efficient JDBC batching.
56+
* <p>
57+
* The sort order respects foreign key dependencies between entities, and
58+
* so also reduces the chance of a foreign key violation.
5159
*
5260
* @see org.hibernate.boot.SessionFactoryBuilder#applyOrderingOfInserts
5361
*

0 commit comments

Comments
 (0)