Hi,
I've been playing with Salat over the weekend and have had trouble
getting even very basic nested case classes to work.
The problem seems to be that all nested classes are written to the
DBObject as-is rather than being evaluated themselves, which means
that when you write them down to mongo, they get serialized as a
BasicDBList. When you then try to load it back from the datastore, you
get errors because the constructors don't match (nested type vs
BasicDBList). I've put up a gist which shows the problem:
https://gist.github.com/2691137
Furthermore, I checked out the latest source from git, and running the
tests against scala 2.9.1 rather than 2.8.1 caused a whole load of
errors of the form:
MatchError: NullaryMethodType(TypeRefType....<snip> Grater.scala:194
If I use the latest snapshot of salat rather than the current maven
repo version on the gist above, I get similar errors to the above,
instead of the constructor-mismatch issue.
Are these related? Is this a configuration problem, or are these known
issues? Is there any way around them to make Salat usable on 2.9.1?
I'd be happy to help out where I can to get it working if changes are
needed.
Best,
Hugh