    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."
+   returned entity records.
+
+   In addition, any field may be marked with a ^:clj metadata tag. This tag
+   means that the field's value goes through prn-str on its way out and through
+   read-string on its way in. It allows automatic serialization for some types
+   not directly supported by the datastore."
+  (get-clj-properties [this]
+    "Returns a set of all properties which pass through the Clojure reader on
+     their way in and out of the datastore.")
   (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

              raw-properties (into {} (.getProperties entity))
              entity-record (record entity-record-type)]
          (with-meta
            (merge entity-record (entity->properties raw-properties))
            {:key (.getKey entity)})))))



                     {: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)
        ;; 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#]
