Annotation Type BatchSize


  • @Target({TYPE,METHOD,FIELD})
    @Retention(RUNTIME)
    public @interface BatchSize
    Specifies a batch size for batch fetching of the annotated entity or collection.

    For example:

        @Entity
        @BatchSize(size = 100)
        class Product {
            ...
        }
     
    will initialize up to 100 lazy Product entity proxies at a time, but:
        @OneToMany
        @BatchSize(size = 5) /
        Set<Product> getProducts() { ... };
     
    will initialize up to 5 lazy collections of products at a time.
    See Also:
    AvailableSettings.DEFAULT_BATCH_FETCH_SIZE
    • Required Element Summary

      Required Elements 
      Modifier and Type Required Element Description
      int size
      Strictly positive integer.
    • Element Detail

      • size

        int size
        Strictly positive integer.