Repo

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

A read & write data repository

Type parameters

E

database entity class

EC

'Entity Creator', which should have all fields of E minus those auto-generated by the database. Can be the same type as E.

ID

id type of E

Attributes

Graph
Supertypes
class ImmutableRepo[E, ID]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def delete(entity: E)(using DbCon): Unit

Deletes an entity using its id

Deletes an entity using its id

Attributes

def deleteAll(entities: Iterable[E])(using DbCon): BatchUpdateResult

Delete all provided entities

Delete all provided entities

Attributes

def deleteAllById(ids: Iterable[ID])(using DbCon): BatchUpdateResult

Deletes all entities with an Iterable of ids

Deletes all entities with an Iterable of ids

Attributes

def deleteById(id: ID)(using DbCon): Unit

Deletes an entity using its id

Deletes an entity using its id

Attributes

def insert(entityCreator: EC)(using DbCon): Unit

Insert and return entity E

Insert and return entity E

Attributes

def insertAll(entityCreators: Iterable[EC])(using DbCon): Unit

Insert and return all new entities

Insert and return all new entities

Attributes

def insertAllReturning(entityCreators: Iterable[EC])(using DbCon): Vector[E]
def insertReturning(entityCreator: EC)(using DbCon): E
def truncate()(using DbCon): Unit

Deletes ALL entities

Deletes ALL entities

Attributes

def update(entity: E)(using DbCon): Unit

Update the entity

Update the entity

Attributes

def updateAll(entities: Iterable[E])(using DbCon): BatchUpdateResult

Update all entities

Update all entities

Attributes

Inherited methods

def count(using DbCon): Long

Count of all entities

Count of all entities

Attributes

Inherited from:
ImmutableRepo
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

Inherited from:
ImmutableRepo
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

Inherited from:
ImmutableRepo
def findAll(using DbCon): Vector[E]

Returns all entity values

Returns all entity values

Attributes

Inherited from:
ImmutableRepo
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

Inherited from:
ImmutableRepo
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

Inherited from:
ImmutableRepo