 (defonce *datastore-implicit-transaction-policy-map*
   {:auto ImplicitTransactionManagementPolicy/AUTO
    :none ImplicitTransactionManagementPolicy/NONE})
-
-
-(defonce *filter-operator-map*
-  {:eq Query$FilterOperator/EQUAL
-   :gt Query$FilterOperator/GREATER_THAN
-   :ge Query$FilterOperator/GREATER_THAN_OR_EQUAL
-   :in Query$FilterOperator/IN
-   :lt Query$FilterOperator/LESS_THAN
-   :le Query$FilterOperator/LESS_THAN_OR_EQUAL
-   :ne Query$FilterOperator/NOT_EQUAL})
-
-
-(defonce *sort-direction-map*
-  {:ascending Query$SortDirection/ASCENDING
-   :asc Query$SortDirection/ASCENDING
-   :descending Query$SortDirection/DESCENDING
-   :dsc Query$SortDirection/DESCENDING
-   :desc Query$SortDirection/DESCENDING})
 
 
 

             (throw err#))))))


(defn query [& {:keys [kind ancestor filter sort keys-only?
                       count-only? in-transaction?
                       limit offset
                       start-cursor end-cursor ; TODO: Implement this.
                       prefetch-size chunk-size]
                :or {keys-only? false, filter [[]], sort [[]],
                     count-only? false, in-transaction? false}}]
  (let [query-object (make-query-object kind ancestor filter sort keys-only?)
        fetch-options-object (make-fetch-options-object limit offset prefetch-size chunk-size)
        prepared-query (if (and in-transaction? *current-transaction*)
                           (.prepare (get-datastore-service) *current-transaction*

    (.put (get-datastore-service) entities)))



;;; ----------------------------------------------------------------------------
;;; query helper objects and functions
;;; ----------------------------------------------------------------------------

(defrecord QueryFilter [operator property value])


(defrecord QuerySort [property direction])


(defn- make-query-object [kind ancestor filters sorts keys-only?]
  (let [kind (cond (nil? kind) kind
                   (string? kind) kind
                   (extends? EntityProtocol kind) (unqualified-name kind)
