JacksonFeatureBiDirReferences - FasterXML Wiki
Annotations are:
@JsonManagedReference is the "forward" part of reference: one that gets serialized normally, and handling of which triggers back-linkage for the other reference
Annotated property can be a bean, array, Collection (List, Set) or Map type, and it must be a bean property (handled by a property of type serialized using BeanSerializer
@JsonBackReference is the "back" part of reference: it will be omitted from serialization, and re-constructed during deserialization of forward reference.
- Annotated property must be of bean type
These annotations can be used for:
* Methods (getters and setters) * Fields
but not for types (classes) or constructor arguments.
Annotations take optional "name" parameter; if omitted default name is used. Name is needed to allow multiple reference pairs for one bean type.
Read full article from JacksonFeatureBiDirReferences - FasterXML Wiki
No comments:
Post a Comment