Trait

model.persistence

SoftCacheLike

Related Doc: package persistence

Permalink

trait SoftCacheLike[Key, _IdType <: Option[Key], CaseClass <: HasId[CaseClass, _IdType]] extends CacheLike[Key, _IdType, CaseClass]

SoftCache contains "soft" values that might expire by timing out or might get bumped if memory fills up. Mix this trait into the DAO to provide this behavior. DAOs that mix in SoftCache do not assume that all instances of the case class can fit into memory.

SoftCache finders that return at most one item from querying the cache will access the database, looking for that item after every cache miss. Because of this, those SoftCache finders run more slowly than StrongCache finders when the cache does not contain the desired value.

SoftCache finders that return a list of items must always query the database and never look in the cache.

The CachedPersistence trait implements the default caching strategy. This trait overrides the default finder implementations. This trait is experimental, do not use in production.

Self Type
SoftCacheLike[Key, _IdType, CaseClass] with CachedPersistence[Key, _IdType, CaseClass]
Source
CacheLike.scala
Linear Supertypes
CacheLike[Key, _IdType, CaseClass], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SoftCacheLike
  2. CacheLike
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def className: String

    Permalink

    Human-readable name of persisted class

    Human-readable name of persisted class

    Definition Classes
    CacheLike

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. implicit val cacheExecutionContext: CacheExecutionContext

    Permalink
  6. def cacheRemoveId(id: Id[_IdType]): Unit

    Permalink
    Definition Classes
    CacheLike
    Annotations
    @inline()
  7. def cacheSet(i: Id[_IdType], value: CaseClass): Unit

    Permalink
    Definition Classes
    CacheLike
    Annotations
    @inline()
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def findAll: List[CaseClass]

    Permalink

    Cannot assume all values are cached, so always get them from the database

    Cannot assume all values are cached, so always get them from the database

    Definition Classes
    SoftCacheLikeCacheLike
    Annotations
    @inline()
  13. def findById(id: Id[_IdType]): Option[CaseClass]

    Permalink

    First try to fetch from cache, then if not found try to fetch from the database

    First try to fetch from cache, then if not found try to fetch from the database

    Definition Classes
    SoftCacheLikeCacheLike
    Annotations
    @inline()
  14. def flushCache(): Unit

    Permalink
    Definition Classes
    CacheLike
    Annotations
    @inline()
  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  19. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  20. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  21. def preload(): List[CaseClass]

    Permalink

    Flushes the cache and then loads all instances of CaseClass into the cache from the database.

    Flushes the cache and then loads all instances of CaseClass into the cache from the database.

    Definition Classes
    CacheLike
    Annotations
    @inline()
  22. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  23. val theCache: SoftCache[Key, CaseClass]

    Permalink
    Attributes
    protected
    Definition Classes
    SoftCacheLikeCacheLike
  24. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  25. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from CacheLike[Key, _IdType, CaseClass]

Inherited from AnyRef

Inherited from Any

Ungrouped