google-code-export / morphia

Automatically exported from code.google.com/p/morphia
1 stars 0 forks source link

LinkedHash cannot be cast to DBObject #318

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What version are you using? (Morphia/Driver/MongoDB)

Latest snapshot and latest mongodb driver.

I'm getting a Cast error while trying to map a BasicDBObject to my model. This 
model contains a field that is a HashSet<OtherModel> where OtherModel 
implements Map.

The exact error points to this line:

http://code.google.com/p/morphia/source/browse/trunk/morphia/src/main/java/com/g
oogle/code/morphia/mapping/EmbeddedMapper.java?r=1682#167

I can't send the code because it is a private app but let me know if I can do 
anything to help with this.

Just to recap:

HashSet<InnerObject> myfield = new HashSet<InnerObject>();

The basic object that I'm trying to map contains a key myfield that is an 
ArrayList of LinkedHashMap

Thanks

Original issue reported on code.google.com by flaper87 on 1 Sep 2011 at 7:19

GoogleCodeExporter commented 9 years ago
If you're still seeing this problem can you comment over here 
(https://github.com/mongodb/morphia/issues/318) and we can dig in to it.

Original comment by justin....@10gen.com on 1 Mar 2014 at 4:33