报错信息为:
mappedBy reference an unknown target entity property: com.example.accessingdatamysql.entity.OrderProduct.order_id in com.example.accessingdatamysql.entity.Order.orderProducts
这样的问题一般是mappedby 这个字段对应的属性,写错了。
如这里是 Order
类的orderProducts
,mappedby
应该为 orderProducts
类的order
字段,如果写错了,就会报错。