首页 > 其他 > 详细

must have same number of columns as the referenced primary key

时间:2019-05-22 15:56:30      阅读:463      评论:0      收藏:0      [点我收藏+]

在使用Hibernate实现多对多的测试过程中遇到了这个问题

解决的方法: 将黄色字段的内容添加进去

        <set name="customerSet" table="orders" cascade="all">
            <key column="goods_id" ></key>
            <many-to-many class="com.bj186.entity.Customer" column="customers_id"></many-to-many>
        </set>

 

问题的原因: 原因是<many-to-many>的配置中, 少了column这个栏的指定

must have same number of columns as the referenced primary key

原文:https://www.cnblogs.com/zjulanjian/p/10906102.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!