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.
the LookupRef for the entity you wish to find
the database to search in
the reader which converts the Entity to our native entity type T
Some[T]
if the entity exists, None
otherwise
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
the type of the ID, can either be a Long or a LookupRef
the ID of the entity you with to select
the database to look in
the reader that converts the entity into the proper case class
the converter that converts the OD from type I
to the Long that it eventually needs to be
the entity, or an UnresolvedLookupRefException if no entity can be found
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.
the type of the ID, can either be a Long or a LookupRef
the ID of the entity
the database to use
the depth to recursively expand. After you reach this depth, you will only get entity IDs instead of the fully expanded entities.
the JSON
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.
the ID of the entity that you want to select
the database to search in
the reader which converts the Entity to our native entity type T
the converter that converts the OD from type I
to the Long that it eventually needs to be
Some[T]
if the entity exists, None
otherwise
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
the executed query
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.
the reader to convert to the specified entity type
Some(entity)
of there is at lease one result where entity
is the first entity found, or None
if there
are no results
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.
the Datomic Query
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.
the reader for the entity
Runs a query and pulls a single page worth of values out.
Runs a query and pulls a single page worth of values out.
the query
the filter
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.
the entity reader
the Page
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.
the type of the ID, can either be a Long or a LookupRef
the ID of the entity to retract
the ExecutionContext
the transaction record specifying whether or not the transaction succeeded or failed
This trait is intended to be mixed into companion objects to make it easy to do basic CRUD functionality.