On Jan 6, 8:20 am, Bill Robertson <[email protected]> wrote:
> On Jan 3, 4:26 pm, "Matthew O. Smith" <[email protected]> wrote:
>
> > There is a mismatch between hibernate maps and clojure maps which
> > means that there is some translating between them. Hopefully, this
> > will be smoothed over in the future
>
> What is the mismatch?
The mismatch is that Hibernate and Clojure see Map object differently
so there is an (in my mind) unnecessary conversion that has to take
place at the boundary between the two systems both in sending data to
Hibernate and also retrieving it. It is not a huge deal, but it is
annoying.
As an example consider this code. Rather than treating a map as
Clojure map (immutable), the develop has to treat the map as a mutable
object.
(with-session [session _]
(let [person (.load session "Person" 1)
email "[email protected]"]
(doto (. person (get "emailAddresses")) (.add email))))
Instead I would like somthing like:
(with-session [session _]
(let [person (.load session "Person" 1)
email "[email protected]"]
(assoc-in person [:emailAddresses] email)))
But that leaves the question of how to propagate the change back to
the Hibernate session.I had thought about some hybrid between
java.util.Map and IMap but decided not as it would end up just
creating more problems than it solves.
It is a problem I am still working on.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en