You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's say you have 1 entity with cascade need to be serialized, when you only need serialize part of cascaded entity, you should do it as following:
class Organization{
private int id;
private String name;
private String address;
private String telehpone;
private String website;
......
}
class Person{
private int id;
private String firstName;
private String lastName;
@JsonIgnoreProperties({"address","telephone","website"})
private Organization organization;
}
but what if the ignored properties is too many and I only need the id and name properties to be serialized?A @JsonOnlyProperties or @JsonIncludeProperties is more convenient and very easy to use.
Think this scenario is most needed.
The text was updated successfully, but these errors were encountered:
and the reason it sort of belongs more in jackson-databind is just because adding annotation is simple, but adding actual handling and support is anything but (due to complexity of processing, at this point).
Let's say you have 1 entity with cascade need to be serialized, when you only need serialize part of cascaded entity, you should do it as following:
but what if the ignored properties is too many and I only need the id and name properties to be serialized?A
@JsonOnlyProperties
or@JsonIncludeProperties
is more convenient and very easy to use.Think this scenario is most needed.
The text was updated successfully, but these errors were encountered: