Interface HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitCacheMemory

Enclosing interface:
HibernateOrmConfigPersistenceUnit

public static interface HibernateOrmConfigPersistenceUnit.HibernateOrmConfigPersistenceUnitCacheMemory
  • Method Summary

    Modifier and Type
    Method
    Description
    The maximum total weight of objects kept in memory in the cache.
    The maximum number of objects kept in memory in the cache.
    The fully qualified class name of a com.github.benmanes.caffeine.cache.Weigher implementation used to assign weights to cache entries.
  • Method Details

    • objectCount

      @ConfigDocDefault("10000") OptionalLong objectCount()
      The maximum number of objects kept in memory in the cache.

      Mutually exclusive with maximum-weight.

    • maximumWeight

      OptionalLong maximumWeight()
      The maximum total weight of objects kept in memory in the cache.

      When set, eviction is based on the total weight of cached entries rather than their count. This is useful for entities with highly variable sizes (e.g., JSON blobs).

      Mutually exclusive with object-count. Requires a weigher-class to assign weights to entries; without one, each entry has a default weight of 1.

    • weigherClass

      Optional<String> weigherClass()
      The fully qualified class name of a com.github.benmanes.caffeine.cache.Weigher implementation used to assign weights to cache entries.

      Only used when maximum-weight is set. The class must have a public no-arg constructor.