Package datomic
Interface Entity
public interface Entity
Implements the Entity API for associative
navigation by attribute keys.
An Entity is lazy - the values of its attributes are not obtained from the db until
get or touch are called, after which they are cached in the entity.
Note that entities have reference-like equality semantics - Two entities are equal
if they have the same id and their databases have the same id
-
Method Summary
Modifier and TypeMethodDescriptiondb()
Gets the value of the attribute named by key, and is polymorphic on key type cardinality :many attributes will always return a collection, even when only one valuekeySet()
touch()
Touches all of the attributes of the entity, including any component entities recursively.
-
Method Details
-
get
Gets the value of the attribute named by key, and is polymorphic on key type cardinality :many attributes will always return a collection, even when only one value- Parameters:
key
- A colon-prefixed string, e.g. ":user/firstName"- Returns:
- the value(s) of that attribute, or null if none
-
touch
Entity touch()Touches all of the attributes of the entity, including any component entities recursively.- Returns:
- this Entity
-
keySet
- Returns:
- the key names of the attributes
-
db
Database db()- Returns:
- the database value that is the basis for this entity
-