[jboss-user] [EJB 3.0] - BatchUpdateException when removing a entity with a ManyToMan

icordoba do-not-reply at jboss.com
Tue Nov 6 20:36:15 EST 2007


Hi there,
I am getting BatchUpdateException when removing entities related to others by a ManyToMany association. Hibernate creates the link table with foreign keys and they make that BatchUpdateException to be thrown (I like tables to have foreign keys, of course).
I've tried to add a REMOVE cascade, but that makes the end entity to be also removed (for example, removing a UserRole entity removes related User, while only should remove the entry in the intermediate link table.
My question is... do I have to remove that relation in target entities before removing the related entity or there is a way to make JBoss/Hibernate to do some intermediate table cascading to remove the relation and avoiding BatchUpdateException?

Thanks for any idea,
Ignacio

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4102376#4102376

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4102376



More information about the jboss-user mailing list