I have a Location object that I need to force the order of the properties when they get persisted to mongodb, but I'm not having much luck figuring out how to do it. The Location class looks something like:
when it get's persisted into mongo, county is always before lat and long. This is a problem because I'm trying to put a geoindex on it and the first two properties must be lat/long.Code:Location { float lat; float lon; County county; }
I have tried:
and that works when the location object is serialized to xml to my client, but not to the DB. It seems that spring data or some mongo mapper is always doing things in alphabetical order.Code:@XmlRootElement(name="location") @XmlType(propOrder={"latitude", "longitude", "county"})
Does anyone know how to force the order properties get persisted into mongo?
Thanks!


Reply With Quote
