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

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

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -