Top Description Fields Constructors Methods
org.hibernate.loader

public final Enum BatchFetchStyle

extends Enum<BatchFetchStyle>
Class Inheritance
Imports
java.util.Locale, org.jboss.logging.Logger

Defines the style that should be used to perform batch loading. Which style to use is declared using the "hibernate.batch_fetch_style" (org.hibernate.cfg.AvailableSettings#BATCH_FETCH_STYLE) setting
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
public static final BatchFetchStyle
DYNAMIC

Dynamically builds its SQL based on the actual number of available ids.

public static final BatchFetchStyle
LEGACY

The legacy algorithm where we keep a set of pre-built batch sizes based on org.hibernate.internal.util.collections.ArrayHelper#getBatchSizes.

private static final Logger
public static final BatchFetchStyle
PADDED

Still keeps the concept of pre-built batch sizes, but uses the next-bigger batch size and pads the extra identifier placeholders.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static BatchFetchStyle
byName(String name)

public static BatchFetchStyle
interpret(Object setting)

public static BatchFetchStyle
public static BatchFetchStyle[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DYNAMICback to summary
public static final BatchFetchStyle DYNAMIC

Dynamically builds its SQL based on the actual number of available ids. Does still limit to the batch-size defined on the entity/collection

LEGACYback to summary
public static final BatchFetchStyle LEGACY

The legacy algorithm where we keep a set of pre-built batch sizes based on org.hibernate.internal.util.collections.ArrayHelper#getBatchSizes. Batches are performed using the next-smaller pre-built batch size from the number of existing batchable identifiers.

For example, with a batch-size setting of 32 the pre-built batch sizes would be [32, 16, 10, 9, 8, 7, .., 1]. An attempt to batch load 31 identifiers would result in batches of 16, 10, and 5.

logback to summary
private static final Logger log
PADDEDback to summary
public static final BatchFetchStyle PADDED

Still keeps the concept of pre-built batch sizes, but uses the next-bigger batch size and pads the extra identifier placeholders.

Using the same example of a batch-size setting of 32 the pre-built batch sizes would be the same. However, the attempt to batch load 31 identifiers would result just a single batch of size 32. The identifiers to load would be "padded" (aka, repeated) to make up the difference.

Constructor Detail

BatchFetchStyleback to summary
private BatchFetchStyle()

Method Detail

byNameback to summary
public static BatchFetchStyle byName(String name)
interpretback to summary
public static BatchFetchStyle interpret(Object setting)
valueOfback to summary
public static BatchFetchStyle valueOf(String name)
valuesback to summary
public static BatchFetchStyle[] values()