-->
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.  [ 2 posts ] 
Author Message
 Post subject: Correct use of the "merge()" function
PostPosted: Thu Apr 14, 2011 3:57 pm 
Newbie

Joined: Thu Apr 14, 2011 3:43 pm
Posts: 2
Hello, I'm quite a beginner using Hibernate and after reading several tutorials the following issue has arisen in my project.

I've an entity that has a large number of relationships, where some of them have also several relationships with other entities. If my understanding of the tutorials is right, I should use “session.update(…)” only if I am completely sure that the main entity hasn't several attributes pointing to the same foreign key. Therefore, I am using “session.merge(…)” instead of save. To this end, in the entity mapping, I've set every foreign key with “cascade = merge”. Hosver, I have a problem doing that way, when I call “session.merge(…)” hibernate generates a query with more than 61 joins, which it is not supported by MySQL. Hence, I have tried to use “session.get(…)” before using the merge . Nevertheless, this solution also generates a query with more than 61 joins due to one of the relationships.

Do you have any suggestions in order to solve my problem?

Thanks in advance.


Top
 Profile  
 
 Post subject: Re: Correct use of the "merge()" function
PostPosted: Mon Apr 18, 2011 9:51 am 
Newbie

Joined: Thu Apr 14, 2011 3:43 pm
Posts: 2
Any idea???


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.