abstract class Repo[M] extends AnyRef
a repository for persistent objects in a model
- M
the model
- Source
- Repo.scala
- Alphabetic
- By Inheritance
- Repo
- AnyRef
- Any
- by repoToPlayRepo
- by repoToIterateeIoRepo
- by repoToFS2Repo
- by repoToAkkaStreamsRepo
- by PWithEv
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Type Members
-
final
class
Retrieve
[P] extends AnyRef
a container for part two of a two part call for retrieving an optional persistent object from a key value
a container for part two of a two part call for retrieving an optional persistent object from a key value
- See also
-
final
class
RetrieveOne
[P] extends AnyRef
a container for part two of a two part call for retrieving a persistent object from a key value
a container for part two of a two part call for retrieving a persistent object from a key value
- See also
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- def ->[B](y: B): (Repo[M], B)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
closeSession()(implicit executionContext: ExecutionContext): Future[Unit]
closes any open session from the underlying database
-
def
create[P](unpersisted: P)(implicit arg0: PEv[M, P], executionContext: ExecutionContext): Future[PState[P]]
creates the persistent object
creates the persistent object
- unpersisted
the persistent object to create
- executionContext
the execution context
-
def
createMany(pWithEvs: PWithEv[M, _]*)(implicit executionContext: ExecutionContext): Future[Seq[PState[_]]]
creates many persistent objects at once
creates many persistent objects at once
because PWithEv is an implicit class, you can call this method using just persistent objects, and they will be converted to
PWithEvimplicitly:repo.createMany(user1, user2, user2, blogPost1, blogPost2, blog)
- pWithEvs
the persistent objects to persist, wrapped with their evidence
- executionContext
the execution context
-
def
createSchema()(implicit context: ExecutionContext): Future[Unit]
non-desctructively creates any needed database constructs
-
def
delete[P](state: PState[P])(implicit arg0: PEv[M, P], executionContext: ExecutionContext): Future[Deleted[P]]
deletes the persistent object
deletes the persistent object
- state
the persistent state of the persistent object to delete
- executionContext
the execution context
- def ensuring(cond: (Repo[M]) ⇒ Boolean, msg: ⇒ Any): Repo[M]
- def ensuring(cond: (Repo[M]) ⇒ Boolean): Repo[M]
- def ensuring(cond: Boolean, msg: ⇒ Any): Repo[M]
- def ensuring(cond: Boolean): Repo[M]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
queryToAkkaStream[P](query: Query[P])(implicit arg0: PEv[M, P]): Source[PState[P], NotUsed]
streams persistent objects matching a query
streams persistent objects matching a query
- query
the query to execute
- Implicit
- This member is added by an implicit conversion from Repo[M] to AkkaStreamsRepo[M] performed by method repoToAkkaStreamsRepo in longevity.persistence.
- Definition Classes
- AkkaStreamsRepo
-
def
queryToFS2[P](query: Query[P])(implicit arg0: PEv[M, P]): Stream[Task, PState[P]]
streams persistent objects matching a query
streams persistent objects matching a query
- query
the query to execute
- Implicit
- This member is added by an implicit conversion from Repo[M] to FS2Repo[M] performed by method repoToFS2Repo in longevity.persistence.
- Definition Classes
- FS2Repo
-
def
queryToFutureVec[P](query: Query[P])(implicit arg0: PEv[M, P], context: ExecutionContext): Future[Vector[PState[P]]]
retrieves multiple persistent objects matching a query
retrieves multiple persistent objects matching a query
- query
the query to execute
-
def
queryToIterateeIo[P, F[_]](query: Query[P])(implicit arg0: PEv[M, P], F: Monad[F]): Enumerator[F, PState[P]]
streams persistent objects matching a query
streams persistent objects matching a query
- query
the query to execute
- Implicit
- This member is added by an implicit conversion from Repo[M] to IterateeIoRepo[M] performed by method repoToIterateeIoRepo in longevity.persistence.
- Definition Classes
- IterateeIoRepo
-
def
queryToIterator[P](query: Query[P])(implicit arg0: PEv[M, P]): Iterator[PState[P]]
retrieves multiple persistent objects matching a query
retrieves multiple persistent objects matching a query
- query
the query to execute
-
def
queryToPlay[P](query: Query[P])(implicit arg0: PEv[M, P], context: ExecutionContext): Enumerator[PState[P]]
streams persistent objects matching a query
streams persistent objects matching a query
- query
the query to execute
- Implicit
- This member is added by an implicit conversion from Repo[M] to PlayRepo[M] performed by method repoToPlayRepo in longevity.persistence.
- Definition Classes
- PlayRepo
-
def
retrieve[P]: Retrieve[P]
part one of a two-part call for retrieving an optional persistent object from a key value.
part one of a two-part call for retrieving an optional persistent object from a key value.
the complete two-part call will end up looking like this:
val f: Future[Option[PState[User]]] = repo.retrieve[User](username)
the call is split into two parts this way to prevent you from having to explicitly name the type of your key value. without it, the call would look like this:
val f: Future[Option[PState[User]]] = repo.retrieve[User, Username](username)
- See also
-
def
retrieveOne[P]: RetrieveOne[P]
part one of a two-part call for retrieving a persistent object from a key value.
part one of a two-part call for retrieving a persistent object from a key value.
the complete two-part call will end up looking like this:
val f: Future[PState[User]] = repo.retrieveOne[User](username)the call is split into two parts this way to prevent you from having to explicitly name the type of your key value. without it, the call would look like this:
val f: Future[PState[User]] = repo.retrieveOne[User, Username](username)- See also
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
update[P](state: PState[P])(implicit arg0: PEv[M, P], executionContext: ExecutionContext): Future[PState[P]]
updates the persistent object
updates the persistent object
- state
the persistent state of the persistent object to update
- executionContext
the execution context
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- def →[B](y: B): (Repo[M], B)