Hi All :)
I'm using Hibernate in my web application, everything works fine and I need to develop a web service that get an object from my application.
I did it, but I receive the following exception:
Code:
java.lang.StackOverflowError
I realized that the problem is caused by "recursive" objects.
For example:
Code:
public class Company{
private Project project;
//gets and sets
}
Code:
public class Project{
private Company company;
//gets and sets
}
If I remove the company object from the class Project, everything works fine.
How can I avoid this? Is there a way to solve this problem in Hibernate but not modifying my objects structure?