Ok, so for maps with an embeddable as value type, it gets even worse:
@Entity public class Enterprise { String id; Map<String, Department> departments = new HashMap<>(); } @Embeddable public class Department { String name; headCount; }
That's what we persist atm.:
{ "_id" : "enterprise-1", "departments" : [ { "value" : { "headCount" : NumberLong(7), "name" : "Sawing" }, "departments_KEY" : "sawing" }, { "value" : { "headCount" : NumberLong(2), "name" : "Sale" }, "departments_KEY" : "sale" } ] }