JPA insert parent/child results in MySQLIntegrityConstraintViolationException

前端 未结 4 1220
情歌与酒
情歌与酒 2020-12-29 00:12

This has already been asked a number of times, but I don\'t find any good answers so I\'ll ask it again.

I have parent-children unidirectional relation as follows:

4条回答
  •  灰色年华
    2020-12-29 01:05

    Adding updatable=false to the parent entity solved the problem with both an insert and an updated being executed on the child table. However, I have no clue why that's the case and in fact, I don't think what I am doing is correct because it means I cannot update the child table later on if I have to.

提交回复
热议问题