       (doseq [[k v] propmap]
         (.setProperty e (subs (str k) 1) (get-val-ds v))))
     ;; (let [pem (PersistentEntityMap. e nil)
-    ;;       ds ds]
-    ;;   ;; (log/trace "ctor-push.put-proper-emap ds: " ds (type ds))
+    ;;       datastore ds]
+    ;;   ;; (log/trace "ctor-push.put-proper-emap ds: " datastore (type ds))
     ;;   (into store-map pem)
     ;;   pem)))
-    (.put ds e)
-    (->PersistentEntityMap e nil)))
+    (.put datastore e)
+    (ds/->PersistentEntityMap e nil)))
 
 (defn get-prefix-matches
   [keychain]
   ;; precon: keychain has already been validated
   (log/trace "get-prefix-matches" keychain)
-  (let [prefix (apply k/entity-key keychain)
+  (let [prefix (apply ds/vector->Key keychain)
         q (.setAncestor (Query.) prefix)
-        prepared-query (.prepare ds q)
+        prepared-query (.prepare datastore q)
         iterator (.asIterator prepared-query (FetchOptions$Builder/withDefaults))
         seq  (iterator-seq iterator)
         res (migae.datastore.PersistentEntityMapSeq. seq)]

;;               ;; (log/trace "setting val" val (type val))
;;               ;; (flush)
;;               (.setProperty e prop val)))))
;;       (.put ds e)
;;       ;; (log/trace "saved entity " e)
;;       (PersistentEntityMap. e nil))))

;; (defn- emap-update-empty
;;   [keychain]
;;   (let [k (apply entity-key keychain)
;;         e (try (.get ds k)
;;                (catch EntityNotFoundException e nil)
;;                (catch DatastoreFailureException e (throw e))
;;                (catch java.lang.IllegalArgumentException e (throw e)))]
;;     (if (ds/entity-map? e)
;;           (PersistentEntityMap. e nil)
;;           (let [e (Entity. k)]
;;             (.put ds e)
;;             (PersistentEntityMap. e nil)))))

;; TODO: support embedded maps, e.g. (ds/emap!! [:Foo/bar] {:a 1, :b {:c 3, :d 4}})

        fq (doseq [pred filter]
             (log/trace "\tpred: " pred)
             (.setFilter q pred))
        pq (.prepare datastore q)
        iterator (.asIterator pq)
        seq (iterator-seq iterator)
        pemseq (migae.datastore.PersistentEntityMapSeq. seq)]
