[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Object Relational Mapping
 
RSS feed
 
New topic
Author

Hibernate trying to insert recursive object - I don't want it to

chris gar
Ranch Hand

Joined: Jul 20, 2002
Messages: 39

I have a class with a recursive association:



the parent is optional but I don't think I have the correct mapping. Every time I try to insert a record with a null parent, it tries to insert a new one for the parent once the child is created. The parent field should only reference a preexisting object in the database.

Here is the error message


I'm sure it's something silly in my mapping. Any suggestions?
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Object Relational Mapping
 
RSS feed
 
New topic
JProfiler
Get rid of your performance problems and memory leaks!