I need some help serializing 2 entities:

entityA {
  public String A;
  public Set<entityB> children;
}

entityB {
  public String X;
  public String Y;
  public String Z;
}

When entityA is serialized, I would like "String X" and "String Z" to be 
serialized for entityB. However, when entityB is serialized on it's own 
(not as part of entityA children), I would like all properties to be 
serialized.

How can I go about doing this. It doesn't appear that I can have 
@JsonIdentityInfo objects, only single property. Is there a way I can have 
a "default" JsonView for a class and then specify a "custom" JsonView when 
I only want to serialize String X & Y of entityB? I would rather not have 
to specify @JsonView on every REST service that serializes entityB.




-- 
You received this message because you are subscribed to the Google Groups 
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to