[Email protected]
The specified field is not serialized, and the Exampaper directory field is not serialized as follows
@OneToMany (Mappedby = "Directory", fetch = fetchtype.lazy) @JsonIgnoreProperties ("directory") Private List<exampaper> exampapers;
[Email protected]
Annotated fields are not serialized
[email protected] and @jsonbackreference
When serializing, attributes that are @JsonBackReference labels are ignored. Attributes that are @JsonManagedReference labeled are serialized.
When serializing, the function of the @JsonBackReference is equivalent to @jsonignore, at which time there can be no @jsonmanagedreference.
When deserializing, if there is no @jsonmanagedreference, the attributes of the @jsonbackreference dimension (the ignored parent or child) are not automatically injected; Automatically injects the attributes of the @jsonbackreference callout.
[Email protected]
Each time the annotated entity class is serialized, Jackson is generated an identity ID for it, and if an object with the same ID (that is, the same object) is encountered, it is not serialized again, ignored directly, and can be severed from the circular reference
An infinite loop solves the problem when the entity class bidirectional mapping is JSON serialized