Aug 20th, 2010, 09:51 PM
MappingJacksonJSONView and ShallowEtagHeaderFilter
I am using a MappingJacksonJsonView and applying the ShallowEtagHeaderFilter to it, but it looks like the Etag is coming out different each time even though the contents of the Model hasn't changed.
It looks like this is because the one-to-many relationships in Roo/Spring are all implemented as Set's which don't guarantee order. So the calculated Etag is indeterminate.
Is there some way to force a sort order in MappingJacksonJsonView or in the Entities themselves? Or should I investigate a "Deep" Etag implementation?
(I'm currently working with Roo 1.0.2).
Any help is appreciated,
Aug 21st, 2010, 10:19 AM
My immediate fix was to go into the Entity in question and manually change the field from Set to List with LinkedList as the implementation.
But in general, I am not sure that it would always be appropriate to change your Entities just to affect this change in Etag or json view behavior. And it means one can't use Roo to manage that property.
Tags for this Thread