Search in sources :

Example 1 with Entity

use of datomic.Entity in project fluxgraph by datablend.

the class FluxElement method getFacts.

// Creates a collection containing the set of datomic facts describing this entity
protected Set<Object> getFacts() {
    // Create the set of facts
    Set<Object> theFacts = new HashSet<Object>();
    // Get the entity
    Entity entity = getDatabase().entity(id);
    // Add the base facts associated with this edge
    Set properties = entity.keySet();
    Iterator<Keyword> propertiesIt = properties.iterator();
    while (propertiesIt.hasNext()) {
        Keyword property = propertiesIt.next();
        // Add all properties (except the ident property (is only originally used for retrieving the id of the created elements)
        if (!property.toString().equals(":db/ident")) {
            theFacts.add(FluxUtil.map(":db/id", id, property.toString(), entity.get(property).toString()));
        }
    }
    return theFacts;
}
Also used : Entity(datomic.Entity) Keyword(clojure.lang.Keyword)

Aggregations

Keyword (clojure.lang.Keyword)1 Entity (datomic.Entity)1