Announcement Announcement Module
Collapse
No announcement yet.
MappingJacksonJSONView and ShallowEtagHeaderFilter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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,
    yuji

  • #2
    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.

    yuji
    ----

    Comment

    Working...
    X