3 Replies Latest reply on Aug 29, 2003 3:11 AM by 3dface

    How to restrict removal of beans which referenced by others

    3dface Newbie


      I have two entities with 1:n relationship.

      When I delte entity with multiplicity one, relational property of second entity becomes null.

      That behavior is not suitable for me, I want to restrict the removal.

      I have foreign key in the relative table. When I try to delete a record from the first table directly from the database I receive expected result - restriction.

      It seems like JBoss first set relative property to null and then deletes master entity.

      What can I do to avoid this?

      (Database is MySql 4.0; table types is InnoDB, so foreign keys works fine.)