API Note
This is used with IN-list style loading to determine the number of keys to encode into the SQL restriction to make sure we do not exceed database/driver limits on the number of JDBC parameters. Generally, prefer using a SQL ARRAY parameter for the keys instead if the database/driver supports it.
Dialect#getMultiKeyLoadSizingStrategy(), org.hibernate.annotations.BatchSize , org.hibernate.Session#byMultipleIds , org.hibernate.Session#byMultipleNaturalId
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: The number of keys to load at once. The total number of JDBC parameters needed for that load is defined bynumberOfKeys * numberOfKeyColumns. The strategy should take care to ensure that
numberOfKeys * numberOfKeyColumns does not exceed any database/driver limits on the number
of parameters allowed in a java.sql.PreparedStatement.The number of columns to which the key is mapped numberOfKeyColumns, int The total number of keys we need to load numberOfKeys, boolean inClauseParameterPaddingEnabled)Determine the optimal batch size (number of key values) to load at a time. |
| determineOptimalBatchLoadSize | back to summary |
|---|---|
| public int determineOptimalBatchLoadSize(int numberOfKeyColumns, int numberOfKeys, boolean inClauseParameterPaddingEnabled) Determine the optimal batch size (number of key values) to load at a time.
The return can be less than the total
API Note
| |