There is an employee entity, it can have multiple address entities. I have added @ManyToOne of employee class to the address object
In most get calls i want to return only the employee object. But at times i want to return an employee object with an address list. How do I achieve this?
Something similar to what is happening in the below question. I just want to make it work on a toggle Spring: When getting a ManyToOne entity, reference entity (OneToMany) is not showing in JSON