I have two classes:
class Person {
@DBRef
@JsonManagedReference
private List<Task> tasks;
}
class Task {
@DBRef
@JsonBackReference
private Person person;
}
When I query to find all Persons the list of Tasks is populated with the associated Tasks. That's what I want.
When I query to find all Tasks, I expected to receive an Task object with the associate Person on it, but I'm receiving without the Person field as null. I want to receive the associated Person as well.