0 Replies Latest reply on Mar 9, 2009 5:01 PM by Dirk Gerrit Oort

    Semantics merge and cascade.merge (cascade.all)

    Dirk Gerrit Oort Newbie

      I've a question of the semantics of merge and the casdetype.merge. I thought that merge means: find a object with the same id ( and type ) in the database when it isn't there add this object (and all it childs with cascadetype.merge) and return this new object.

      When the object with the same id is in the database than all the changes from the incoming object must merge into the database and when there is a cascadetype.merge that relation must be merged into the database too.

      So when I have a A and a one-to-many relation with B the changes on the B's must be merged into the data base too. When this is a delete on a B than this B must be deleted too. (Remove on A will delete all B's too when there is a cascadetype.delete)

      But on jboss 5.01.ga (or others ) A and its simple properties are merged the Updates on the B's and inserts new B are also merged but a delete B will disconnect the B with the A but this delete will not affect the row in the Table B it stays in the database and in the end it pollute the database with row's that must be deleted by hand.

      The big question is have I understood the functionality of merge well or not, and wat is is the right functionality of merge and cascadetype.merge

      I've used a mysql 5.0 database a remote client and jboss 5.01.ga.