                      {:keys [kind]
                       :or {kind (unqualified-name name)}}]
   (let [key-property-name (first (filter #(= (:tag (meta %)) :key) properties))
-        key-property (if key-property-name (keyword (str key-property-name)) nil)]
+        key-property (if key-property-name (keyword (str key-property-name)) nil)
+        ;; XXX: The keyword and str composition below works
+        ;; around a weird Clojure bug (see
+        ;; http://groups.google.com/group/clojure-dev/browse_thread/thread/655f6e7d1b312f17).
+        clj-properties (set (map (comp keyword str)
+                                 (filter #(= (:tag (meta %)) :clj) properties)))]
     `(defrecord ~name ~properties
        EntityProtocol
+       (get-clj-properties [this#]
+         ~clj-properties)
        (get-key-object [this#]
          (get-key-object-helper this# ~key-property ~kind nil))
        (get-key-object [this# parent#]

   field becomes the key. If a record has no :key metadata tags, then a key is
   automatically generated for it. In either case, the key becomes part of the
   entity's metadata. Entity retrieval operations must set the :key metadata on
   returned entity records."
  (get-key-object [this] [this parent]
    "Returns nil if no tag is specified in the record definition, and no :key
     metadata exists. Otherwise returns a Key object. Specify optional entity

    fetch-options-object))


(defn- entity->properties [raw-properties clj-properties]
  (reduce (fn [m [k v]]
            (let [k (keyword k)]
             (assoc m k (if (contains? clj-properties k)
                            (binding [*read-eval* false]
                              (read-string (.getValue v)))
                            (coerce-java-type v)))))
          {}
          raw-properties))

