Package datomic
Interface Entity
-
public interface EntityImplements 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Databasedb()java.lang.Objectget(java.lang.Object key)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 valuejava.util.Set<java.lang.String>keySet()Entitytouch()Touches all of the attributes of the entity, including any component entities recursively.
-
-
-
Method Detail
-
get
java.lang.Object get(java.lang.Object key)
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
java.util.Set<java.lang.String> keySet()
- Returns:
- the key names of the attributes
-
db
Database db()
- Returns:
- the database value that is the basis for this entity
-
-