-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Problems with "recursive" objects.
PostPosted: Wed Aug 29, 2007 3:57 pm 
Newbie

Joined: Wed Aug 29, 2007 3:30 pm
Posts: 1
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?


Top
 Profile  
 
 Post subject: credits if you like the answer
PostPosted: Wed Aug 29, 2007 5:00 pm 
Beginner
Beginner

Joined: Fri May 11, 2007 11:03 am
Posts: 32
I dont think hibernate would go deeper into recursive objects.
It would have been nice if you had posted the code between session open and close so that people can better understand your problem


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 30, 2007 11:00 am 
Regular
Regular

Joined: Thu Oct 19, 2006 12:07 pm
Posts: 75
And the mapping definitions too...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.