Enum Class PdoCacheStrategy

java.lang.Object
java.lang.Enum<PdoCacheStrategy>
org.tentackle.pdo.PdoCacheStrategy
All Implemented Interfaces:
Serializable, Comparable<PdoCacheStrategy>, Constable

public enum PdoCacheStrategy extends Enum<PdoCacheStrategy>
Eviction strategy for the PDO-cache.
Author:
harald
  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    If a PDO is not in the cache, it will be loaded from the database.
    When the maximum size of the cache reached, the cache is purged completely.
    If a PDO is not in the cache, it will be loaded from the database.
    When the maximum size of the cache reached, the least frequently used PDOs are removed from the cache, according to a keep-quota.
    If a PDO is not in the cache, it will be loaded from the database.
    When the maximum size of the cache reached, the least recently used PDOs are removed from the cache, according to a keep-quota.
    Preload all PDOs.
    This is the default and works for the majority of master-data entities.
    The first select from the cache will load all entities from the database so that further selects will not need a physical load from the database.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • PRELOAD

      public static final PdoCacheStrategy PRELOAD
      Preload all PDOs.
      This is the default and works for the majority of master-data entities.
      The first select from the cache will load all entities from the database so that further selects will not need a physical load from the database.
    • FORGET

      public static final PdoCacheStrategy FORGET
      If a PDO is not in the cache, it will be loaded from the database.
      When the maximum size of the cache reached, the cache is purged completely.
    • LRU

      public static final PdoCacheStrategy LRU
      If a PDO is not in the cache, it will be loaded from the database.
      When the maximum size of the cache reached, the least recently used PDOs are removed from the cache, according to a keep-quota.
    • LFU

      public static final PdoCacheStrategy LFU
      If a PDO is not in the cache, it will be loaded from the database.
      When the maximum size of the cache reached, the least frequently used PDOs are removed from the cache, according to a keep-quota.
  • Method Details

    • values

      public static PdoCacheStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PdoCacheStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null