Preserving objects not mapped ?

27 views
Skip to first unread message

Bjørn-Willy Arntzen

unread,
Sep 4, 2018, 3:03:57 AM9/4/18
to Morphia
Hello all.

I stumbled over this group, and have this issue:

Currently using mongojack. that works fine, but if I put a field in the mongo document that is not mapped with the mongojack entity class, it's gone after a read and write.

Is it possible to preserve all filed not mapped with Morphia ?

Example: 

class Employee { @Id private ObjectId id; private String name; }

If the mongoDB native document contains other fields (that is not known at this point) and then later is mapped to the EmployeeExtended class ?

class EmployeeExtended { @Id private ObjectId id; private String name; private String address; }


If this is done with mongojack the address is gone after a read/write of Employee.
Reply all
Reply to author
Forward
0 new messages