I don\'t understand the behavior of Hibernate when mapping a bidirectional list. The SQL statements that Hibernate produces seem not optimal to me. Can somebody enlighten me?
Ok, I was not reading the Annotations Reference Guide thoroughly enough.
In Chapter 2.2.5.3.1.1. Bidirectional it is stated clearly:
To map a bidirectional one to many, with the one-to-many side as the owning side, you have to remove the mappedBy element and set the many to one @JoinColumn as insertable and updatable to false. This solution is obviously not optimized and will produce some additional UPDATE statements.
It probably would not hurt to repeat this information in Chapter 2.4.6.2.1. Bidirectional association with indexed collections .
Now the question remains: if I repeat the @JoinColumn attributes 'updatable = false' and 'insertable = false' on the Parent (see code in first post) the additional update statements seem not to get produced... is this a legitimate workaround? Or does this result in another problem?