报错
INFO: HHH000327: Error performing load command : org.hibernate.exception.SQLGrammarException: could not extract ResultSet
Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not extract ResultSet
.....
Caused by: java.sql.SQLSyntaxErrorException: Unknown column 'orderlist0_.good_id' in 'field list'
解决
直译:字段不匹配
之前有一次时因为数据库里的字段多了一个空格;
这次时因为映射文件里的表写错了,
<list name="orderList" cascade="all" inverse="true" lazy="false">
<key column="good_id"/> <!-- 我是商品,想要订单,得通过外键表中我的索引来查找 -->
<index column="good_index"/>
<one-to-many class="GoodOrder"/>
</list>
对应的表类应该是GoodOrder,我之前写成了Order;