Let's say I have following POJO's using Hibernate.
public class User {
private String userName;
private String name;
private String surname;
private List<Blog> blogList;
//All getters and setters are found here and assume they're generated.
}
public class Blog {
private String title;
private String content;
private User author;
private Date datePublished;
private Date dateLastModified;
//All getters and setters have been generated (by Eclipse or NetBeans)
}
As stated here Hibernate prevents infinite loops while data retrieval. My application architecture uses two different types of transfer objects. One for backend and one for frontend purposes. In the middle of both a converter translates them. Here I am encountering the problem hibernate prevented earlier.
One solution could be changing relation to unidirectional. But is there another solution that lets me use a bidirectional approach?