diff --git a/hibernate-core/src/main/java/org/hibernate/BatchSize.java b/hibernate-core/src/main/java/org/hibernate/BatchSize.java new file mode 100644 index 000000000000..1c848dc59d13 --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/BatchSize.java @@ -0,0 +1,50 @@ +/* + * SPDX-License-Identifier: LGPL-2.1-or-later + * Copyright Red Hat Inc. and Hibernate Authors + */ +package org.hibernate; + +import jakarta.persistence.FindOption; + +import java.util.List; + +/** + * Specify a batch size, that is, how many entities should be + * fetched in each request to the database, for an invocation of + * {@link Session#findMultiple(Class, List, FindOption...)}. + * + *

+ * If an explicit batch size is set manually, care should be taken + * to not exceed the capabilities of the underlying database. + *

+ * The performance impact of setting a batch size depends on whether + * a SQL array may be used to pass the list of identifiers to the + * database: + *