-->
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: Many-To-Many Mapping Issue
PostPosted: Fri Jul 07, 2006 9:56 am 
Newbie

Joined: Fri Jul 07, 2006 8:04 am
Posts: 4
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.1.3

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


I have a many-to-many mapping in, the following example Employee, Employee-Department and Department,

I have some finders using HQL in the employee bean, when ever I invoke the finders, I could see in the console that Hibernate is deleting some entries from the Employee-Department table and inserting again.

Why is that Hibernate is executing delete and insert statements for a simple finder. Is there any settings which can stop this?

Thanks
Muthu


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 07, 2006 4:15 pm 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
Could you be a bit more precise about your mapping and your issue ? Which code is in your finder ? How is it called ?

Sometimes, it's totally normal that Hibernate must delete all lines of a collection to only leave the good ones, because it's the only way to do so. But knowing if the behaviour is normal or not for your case requires more informations...

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


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.