Hi,
I am using Spring Data with MongoDB. It works very well. However, I'm seeing a bit of an anomaly.
I have an object:
This object is in a collection that is part of a bean hierarchy that gets persisted into MongoDB. It appears as though the @Field annotation is being ignored on occasion.Code:@Data public class BillingCodesOwner { @Field("oid") private String ownerId; @Field("oln") private String ownerLastName; @Field("ofn") private String ownerFirstName; @Field("ost") private BillingCodesState ownerState; @Field("odt") private Date ownershipDate; }
As you can see, the bottom entry has the @Field identifiers, where the top two do not.Code:"ost" : [ { "ownerId" : null, "ownerFirstName" : null, "ownerLastName" : null, "ownershipDate" : null, "ownerState" : "UNASSIGNED" }, { "ownerId" : "51303e8cda06ab8bb3832b82", "ownerFirstName" : "Tod", "ownerLastName" : "Antilla", "ownershipDate" : ISODate("2013-03-06T01:13:35.127Z"), "ownerState" : "ASSIGNED" }, { "oid" : "51303e8cda06ab8bb3832b82", "oln" : "Antilla", "ofn" : "Tod", "ost" : "CODED", "odt" : ISODate("2013-03-06T01:13:54.796Z") } ],
These are persisted exactly the same way, however, the bean graph having the first two entries went to the client and came back before being persisted. Why would serializing/deserializing and sending this to an ActionScript client ignore the @Field annotations? My impression was that the @Field annotations were checked every time these beans are persisted. Is that not true?
Thanks,
Tom


Reply With Quote
