Thanks Vlad. I think I got it and want to make sure that we are on the same page.
With Unidirectional map using the join table, the issue with child deletes is that it removes all the existing associations from the join table and then adds them again with the updated list.
With my option 2, with unidirectional map and no join table and child table emulating FK, I see two queries being fired as below to delete a child record (Tree) as below, an extra query:
Code:
update Tree set FOREST=null where FOREST=? and id=?
delete from Tree where id=? and version=?
And with option 1, with bidirectional mapping and ManyToOne owning the relationship, I see only one query being fired as below to delete a child record (Tree):
Code:
delete from Tree where id=? and version=?
Correct me if I got it wrong.