ImmutableRepo

com.augustnagro.magnum.ImmutableRepo
open class ImmutableRepo[E, ID](using defaults: RepoDefaults[_, E, ID])

Repository supporting read-only queries. When entity E does not have an id, use Null for the Id type.

Type parameters

E

database entity class

ID

id type of E

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Repo[EC, E, ID]

Members list

Value members

Concrete methods

def count(using DbCon): Long

Count of all entities

Count of all entities

Attributes

def existsById(id: ID)(using DbCon): Boolean

Returns true if an E exists with the given id

Returns true if an E exists with the given id

Attributes

def findAll(using DbCon): Vector[E]

Returns all entity values

Returns all entity values

Attributes

def findAll(spec: Spec[E])(using DbCon): Vector[E]

Find all entities matching the specification. See the scaladoc of Spec for more details

Find all entities matching the specification. See the scaladoc of Spec for more details

Attributes

def findAllById(ids: Iterable[ID])(using DbCon): Vector[E]

Find all entities having ids in the Iterable. If an Id is not found, no error is thrown.

Find all entities having ids in the Iterable. If an Id is not found, no error is thrown.

Attributes

def findById(id: ID)(using DbCon): Option[E]

Returns Some(entity) if a matching E is found

Returns Some(entity) if a matching E is found

Attributes