Trait/Object

datomiscadao

DB

Related Docs: object DB | package datomiscadao

Permalink

trait DB[T] extends AnyRef

This trait is intended to be mixed into companion objects to make it easy to do basic CRUD functionality.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DB
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Abstract Value Members

  1. implicit abstract val reader: EntityReader[T]

    Permalink
  2. implicit abstract val writer: PartialAddEntityWriter[T]

    Permalink

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 clone(): AnyRef

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  8. def execute0(myQuery: AbstractQuery)(implicit conn: Connection): Iterable[Any]

    Permalink
  9. def execute1(myQuery: AbstractQuery, param: Long)(implicit conn: Connection): Iterable[Any]

    Permalink
  10. def execute1(myQuery: AbstractQuery, param: String)(implicit conn: Connection): Iterable[Any]

    Permalink
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def find(ref: LookupRef)(implicit conn: Connection, reader: EntityReader[T]): Option[T]

    Permalink
  13. def find(ref: LookupRef, db: Database)(implicit reader: EntityReader[T]): Option[T]

    Permalink

    Similar to get(id: Long) except this method will not throw an exception of the entity with the specified ID exists, instead, it simply returns a None.

    Similar to get(id: Long) except this method will not throw an exception of the entity with the specified ID exists, instead, it simply returns a None. This is useful for when you are not sure whether or not an entity has been retracted.

    ref

    the LookupRef for the entity you wish to find

    db

    the database to search in

    reader

    the reader which converts the Entity to our native entity type T

    returns

    Some[T] if the entity exists, None otherwise

  14. def find[I](id: I)(implicit conn: Connection, reader: EntityReader[T], idConv: AsPermanentEntityId[I]): Option[T]

    Permalink
  15. def find[I](id: I, db: Database)(implicit reader: EntityReader[T], idConv: AsPermanentEntityId[I]): Option[T]

    Permalink
  16. def get[I](id: I)(implicit conn: Connection, reader: EntityReader[T], idConv: AsPermanentEntityId[I]): T

    Permalink
  17. def get[I](id: I, db: Database)(implicit reader: EntityReader[T], idConv: AsPermanentEntityId[I]): T

    Permalink

    Gets an entity by ID, where the ID can either be a Long or a LookupRef.

    Gets an entity by ID, where the ID can either be a Long or a LookupRef. This method will throw an UnresolvedLookupRefException if the ID does not map to an existing entity. this should never be the case for a Long ID, but can potentially be possible when using a LookupRef. If you are not certain that a LookupRef points to an existing entity, call find instead

    I

    the type of the ID, can either be a Long or a LookupRef

    id

    the ID of the entity you with to select

    db

    the database to look in

    reader

    the reader that converts the entity into the proper case class

    idConv

    the converter that converts the OD from type I to the Long that it eventually needs to be

    returns

    the entity, or an UnresolvedLookupRefException if no entity can be found

  18. def getAsJson[I](id: I, db: Database, depth: Int = 10)(implicit idConv: AsPermanentEntityId[I]): JsValue

    Permalink

    Gets an entity in JSON format.

    Gets an entity in JSON format. This is done directly on the Datomic map, so calling this method is an optimization that saves on having to serialize and deserialize from a case class.

    I

    the type of the ID, can either be a Long or a LookupRef

    id

    the ID of the entity

    db

    the database to use

    depth

    the depth to recursively expand. After you reach this depth, you will only get entity IDs instead of the fully expanded entities.

    returns

    the JSON

  19. def getAsTry[I](id: I)(implicit conn: Connection, reader: EntityReader[T], idConv: AsPermanentEntityId[I]): Try[T]

    Permalink
  20. def getAsTry[I](id: I, db: Database)(implicit reader: EntityReader[T], idConv: AsPermanentEntityId[I]): Try[T]

    Permalink

    Similar to get(id: Long) all excpetions are caught and wrapped in a Try.

    Similar to get(id: Long) all excpetions are caught and wrapped in a Try. This is useful in circumstances where perhaps the entity in question was not fully entered into the DB, so while something is there with that ID, there isn't enough to fully inflate the case class.

    id

    the ID of the entity that you want to select

    db

    the database to search in

    reader

    the reader which converts the Entity to our native entity type T

    idConv

    the converter that converts the OD from type I to the Long that it eventually needs to be

    returns

    Some[T] if the entity exists, None otherwise

  21. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  23. def headOption(query: Iterable[Any])(implicit conn: Connection, reader: EntityReader[T]): Option[T]

    Permalink
    Attributes
    protected
  24. def headOption(query: Iterable[Any], db: Database)(implicit reader: EntityReader[T]): Option[T]

    Permalink

    Returns a single entity (the first entity if there are many that match the query) as an option or None if there are no results matching the query

    Returns a single entity (the first entity if there are many that match the query) as an option or None if there are no results matching the query

    query

    the executed query

    db

    the database - Required to convert the entity ID to the full entity. For consistency, This should be the same database that you used to execute the query.

    reader

    the reader to convert to the specified entity type

    returns

    Some(entity) of there is at lease one result where entity is the first entity found, or None if there are no results

    Attributes
    protected
  25. def headOptionWithId(query: Iterable[Any])(implicit conn: Connection, reader: EntityReader[T]): Option[(Long, T)]

    Permalink
    Attributes
    protected
  26. def headOptionWithId(query: Iterable[Any], db: Database)(implicit reader: EntityReader[T]): Option[(Long, T)]

    Permalink
    Attributes
    protected
  27. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  28. def list(query: Iterable[Any])(implicit conn: Connection, reader: EntityReader[T]): List[T]

    Permalink
    Attributes
    protected
  29. def list(query: Iterable[Any], db: Database)(implicit reader: EntityReader[T]): List[T]

    Permalink

    Returns the list of entities chosen by the query tupled with its ID.

    Returns the list of entities chosen by the query tupled with its ID.

    query

    the Datomic Query

    db

    the database - Required to convert the entity ID to the full entity. For consistency, This should be the same database that you used to execute the query.

    reader

    the reader for the entity

    Attributes
    protected
  30. def listWithId(query: Iterable[Any])(implicit conn: Connection, reader: EntityReader[T]): List[(Long, T)]

    Permalink
    Attributes
    protected
  31. def listWithId(query: Iterable[Any], db: Database)(implicit reader: EntityReader[T]): List[(Long, T)]

    Permalink
    Attributes
    protected
  32. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  35. def page(query: Iterable[Any], filter: PageFilter)(implicit db: Database, reader: EntityReader[T]): Page[T]

    Permalink

    Runs a query and pulls a single page worth of values out.

    Runs a query and pulls a single page worth of values out.

    query

    the query

    filter

    the filter

    db

    the database - Required to convert the entity ID to the full entity. For consistency, This should be the same database that you used to execute the query.

    reader

    the entity reader

    returns

    the Page

    Attributes
    protected
  36. def pageWithSort(query: Iterable[(Any, Any)], filter: PageFilter, sort: SortOrder = Asc)(implicit db: Database, reader: EntityReader[T]): Page[T]

    Permalink
    Attributes
    protected
  37. def retractEntity[I](id: I)(implicit conn: Connection, ex: ExecutionContext, idConv: AsPermanentEntityId[I]): Future[TxReport]

    Permalink

    This is the Datomic equivalent of a delete, except in Datomic, nothing ever gets deleted.

    This is the Datomic equivalent of a delete, except in Datomic, nothing ever gets deleted. You can only insert a retraction, that flags the specified entity as ignored.

    I

    the type of the ID, can either be a Long or a LookupRef

    id

    the ID of the entity to retract

    ex

    the ExecutionContext

    returns

    the transaction record specifying whether or not the transaction succeeded or failed

  38. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  39. def toString(): String

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

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped