删除api因为依赖而无法正常工作

时间:2018-02-20 17:26:37

标签: java mysql hibernate rest jpa

我创建REST删除方法从表中删除记录,由于依赖我无法删除它,我搜索并尝试解决但没有运气,这是问题所在:

table A:
name, id, description, userid

table user have user details and userid

there is a relationship between A.userid and user.userid

我想删除表A中没有删除行的用户表中的行,因为同一个用户被分配给其他表B. 我使用Hibernate Mapping和JPA remove()方法删除它,使用CascadeType.ALL和Mysql DB。 即使我们对表A有更多依赖。

0 个答案:

没有答案