枚举 BatchFetchStyle

    • 枚举常量详细资料

      • LEGACY

        public static final BatchFetchStyle LEGACY
        The legacy algorithm where we keep a set of pre-built batch sizes based on ArrayHelper.getBatchSizes(int). 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.

      • PADDED

        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.

      • DYNAMIC

        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
    • 方法详细资料

      • values

        public static BatchFetchStyle[] values()
        按照声明该枚举类型的常量的顺序, 返回 包含这些常量的数组。该方法可用于迭代 常量, 如下所示:
        for (BatchFetchStyle c : BatchFetchStyle.values())
            System.out.println(c);
        
        返回:
        按照声明该枚举类型的常量的顺序返回的包含这些常量的数组
      • valueOf

        public static BatchFetchStyle valueOf​(String name)
        返回带有指定名称的该类型的枚举常量。 字符串必须与用于声明该类型的枚举常量的 标识符完全匹配。(不允许有多余 的空格字符。)
        参数:
        name - 要返回的枚举常量的名称。
        返回:
        返回带有指定名称的枚举常量
        抛出:
        IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量
        NullPointerException - 如果参数为空值