• Cannot add foreign key constraint
    一般遇到这种错误是由于主键和外键的数据类型不一致

  • 但我这次完全不是主外键数据类型不一致
    控制台:Hibernate 一对多 Cannot add foreign key constraint
    我的表是这样的:Hibernate 一对多 Cannot add foreign key constraint
    就算添加外键约束不也是给表car添加吗?为什么会给customer表添加
    而且再看一下控制台打印的添加外键约束的sql语句,Hibernate 一对多 Cannot add foreign key constraintomg,完全是乱来的


检查了无数遍Customer.java、Customer.hbm.xml、Car.java、Car.hbm.java
最终发现是因为Hibernate 一对多 Cannot add foreign key constraint
这是由于这个hbm.xml是copy Customer.hbm.xml的,又忘记改table的值了

相关文章:

  • 2021-10-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
  • 2021-08-06
  • 2022-12-23
猜你喜欢
  • 2022-01-09
  • 2021-06-06
  • 2022-12-23
  • 2022-12-23
  • 2021-11-22
  • 2021-10-13
  • 2022-12-23
相关资源
相似解决方案