I have 2 classes. Parent & Child models(spring with hibernate).
A parent can have any number of children, each child has only one parent.
class Parent{
@OneToMany(mappedBy="parent")
private List<Child> children;
}
class Child{
@ManyToOne
Private Parent parent;
}
Required Json output:
When i request a parent, i should get all its children along with that, but each child should not contain its parent info again.
When i request for a child, i should get its parent along with that, but its parent should not contain all its children info.
What type of jackson annotations should i use for this