Hibernate: Why does a change of bag lead to strange ADDs and DELETEs in the database? -


i have n:m-association between 2 classes user , role, implemented bag lazy="extra". association stored an association table sind user can have many roles , role can associated many users.

now when add new role user, hibernate emmits sql code first removes entries in th eassociation table adds them again plus new association.

i'd know why happens , how can rid of behavior.

ralf

i've found solution myself: hibernate bags first delete alle entreis , rebuild new state. if use set, association maintained.

see hibernate manual, improving performance


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -