Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Type-hint arguments.

  • Loading branch information...
commit a581860d657c9dcef3d2ede7902a1eba54d588e3 1 parent e82966b
@duelinmarkers authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 src/appengine_clj/datastore.clj
11 src/appengine_clj/datastore.clj
@@ -1,18 +1,23 @@
(ns appengine-clj.datastore
- (:import ( DatastoreServiceFactory)))
+ (:import (
+ DatastoreServiceFactory
+ Entity
+ Query)))
(defn entity-to-map
"Converts an instance of
to a PersistentHashMap with properties stored under keyword keys,
plus the entity's kind stored under :kind and key stored under :key."
- [entity]
+ [#^Entity entity]
(reduce #(assoc %1 (keyword (key %2)) (val %2))
{:kind (.getKind entity) :key (.getKey entity)}
(.entrySet (.getProperties entity))))
(defn find-all
- [query]
+ "Executes the given
+ and returns the results as a lazy sequence of items converted with entity-to-map."
+ [#^Query query]
(let [data-service (DatastoreServiceFactory/getDatastoreService)
results (.asIterable (.prepare data-service query))]
(map entity-to-map results)))

0 comments on commit a581860

Please sign in to comment.
Something went wrong with that request. Please try again.