Class

model.persistence

CachedPersistence

Related Doc: package persistence

Permalink

abstract class CachedPersistence[Key, _IdType <: Option[Key], CaseClass <: HasId[CaseClass, _IdType]] extends UnCachedPersistence[Key, _IdType, CaseClass] with CacheLike[Key, _IdType, CaseClass]

Overrides the Persistence methods which accesses the table so the cache is used instead. All instances of the domain model are expected to fit into the cache.

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

Instance Constructors

  1. new CachedPersistence()(implicit arg0: ClassTag[CaseClass])

    Permalink

Abstract Value Members

  1. abstract def _deleteById: (Id[_IdType]) ⇒ Unit

    Permalink

    Encapsulates the Quill query that deletes the instance of the case class with the given Id from the database

    Encapsulates the Quill query that deletes the instance of the case class with the given Id from the database

    Definition Classes
    UnCachedPersistence
  2. abstract def _findAll: List[CaseClass]

    Permalink

    Encapsulates the Quill query that returns all instances of the case class from the database

    Encapsulates the Quill query that returns all instances of the case class from the database

    Definition Classes
    UnCachedPersistence
  3. abstract def _findById: (Id[_IdType]) ⇒ Option[CaseClass]

    Permalink

    Encapsulates the Quill query that optionally returns the instance of the case class from the database with the given Id, or None if not found.

    Encapsulates the Quill query that optionally returns the instance of the case class from the database with the given Id, or None if not found.

    Definition Classes
    UnCachedPersistence
  4. abstract def _insert: (CaseClass) ⇒ CaseClass

    Permalink

    Encapsulates the Quill query that inserts the given instance of the case class into the database, and returns the case class as it was stored, including any auto-increment fields.

    Encapsulates the Quill query that inserts the given instance of the case class into the database, and returns the case class as it was stored, including any auto-increment fields.

    Definition Classes
    UnCachedPersistence
  5. abstract def _update: (CaseClass) ⇒ CaseClass

    Permalink

    Encapsulates the Quill query that updates the given instance of the case class into the database, and returns the entity.

    Encapsulates the Quill query that updates the given instance of the case class into the database, and returns the entity. Throws an Exception if the case class was not previously persisted.

    Definition Classes
    UnCachedPersistence
  6. abstract val theCache: AbstractCache[Key, CaseClass]

    Permalink
    Attributes
    protected
    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. def cacheRemoveId(id: Id[_IdType]): Unit

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

    Permalink
    Definition Classes
    CacheLike
    Annotations
    @inline()
  7. val className: String

    Permalink
    Definition Classes
    UnCachedPersistence
  8. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. val copyUpdate: (CaseClass, Id[_IdType]) ⇒ CaseClass

    Permalink
    Attributes
    protected
    Definition Classes
    UnCachedPersistence
  10. def delete(caseClass: CaseClass): Unit

    Permalink
    Definition Classes
    UnCachedPersistence
    Annotations
    @inline()
  11. def deleteById(id: Id[_IdType]): Unit

    Permalink
    Definition Classes
    CachedPersistenceUnCachedPersistence
    Annotations
    @inline()
  12. final def eq(arg0: AnyRef): Boolean

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

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

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

    Permalink
    Definition Classes
    CachedPersistenceCacheLikeUnCachedPersistence
    Annotations
    @inline()
  16. def findAllFromDB: List[CaseClass]

    Permalink

    Always fetches from the database; bypass cache, useful for startup code.

    Always fetches from the database; bypass cache, useful for startup code. See also CachedPersistence.findAll

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

    Permalink
  18. def findByIdFromDB(id: Id[_IdType]): Option[CaseClass]

    Permalink

    Always fetches from the database; bypass cache, useful for startup code.

    Always fetches from the database; bypass cache, useful for startup code. See also findById

    Definition Classes
    UnCachedPersistence
    Annotations
    @inline()
  19. def flushCache(): Unit

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

    Permalink
    Definition Classes
    AnyRef → Any
  21. def getId(t: CaseClass): Id[Key]

    Permalink
    Definition Classes
    UnCachedPersistence
    Annotations
    @inline()
  22. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  23. def insert(caseClass: CaseClass): CaseClass

    Permalink

    Sanitizes and inserts caseClass.

    Sanitizes and inserts caseClass. Does not check to see if caseClass was previously persisted

    Definition Classes
    CachedPersistenceUnCachedPersistence
    Annotations
    @inline()
  24. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  25. val logger: Logger

    Permalink
    Definition Classes
    UnCachedPersistence
  26. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  29. 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()
  30. def remove(caseClass: CaseClass): Unit

    Permalink

    Searches by CaseClass.id, removes from cache

    Searches by CaseClass.id, removes from cache

    returns

    true if CaseClass was removed (false if the CaseClass was not defined prior)

    Definition Classes
    CachedPersistenceUnCachedPersistence
    Annotations
    @inline()
  31. val sanitize: (CaseClass) ⇒ CaseClass

    Permalink
    Attributes
    protected
    Definition Classes
    UnCachedPersistence
  32. def setAutoInc(implicit ctx: JdbcContext[_, _]): Unit

    Permalink

    This method only has relevance for Postgres databases; it ensures that the next autoInc value is properly set when the app starts.

    This method only has relevance for Postgres databases; it ensures that the next autoInc value is properly set when the app starts. Assumes that column named id is present, and that $${ tableName }_id_seq exists. There is no harm in invoking this method of other types of databases, because it does not do anything unless the database is Postgres.

    Definition Classes
    UnCachedPersistence
    Annotations
    @inline()
    See also

    https://stackoverflow.com/a/244265/553865 List sequences with

    \ds
  33. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  34. lazy val tableName: String

    Permalink
    Definition Classes
    UnCachedPersistence
  35. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  36. def update(caseClass: CaseClass): CaseClass

    Permalink

    Sanitizes and updates caseClass.

    Sanitizes and updates caseClass. Does not check to see if caseClass was previously persisted

    Definition Classes
    CachedPersistenceUnCachedPersistence
    Annotations
    @inline()
  37. def upsert(caseClass: CaseClass): CaseClass

    Permalink

    Sanitizes and inserts or updates caseClass

    Sanitizes and inserts or updates caseClass

    Definition Classes
    CachedPersistenceUnCachedPersistence
    Annotations
    @inline()
  38. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. def zap(): Unit

    Permalink
    Definition Classes
    CachedPersistenceUnCachedPersistence
    Annotations
    @inline()

Inherited from CacheLike[Key, _IdType, CaseClass]

Inherited from UnCachedPersistence[Key, _IdType, CaseClass]

Inherited from AnyRef

Inherited from Any

Ungrouped