must have same number of columns as the referenced primary key

时间:2019-05-22 15:56:30   收藏:0   阅读:466

在使用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这个栏的指定

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

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!