读书人

Hibernate 多对1的 实现

发布时间: 2012-10-27 10:42:26 作者: rapoo

Hibernate 多对一的 实现
在一对多的问题中遇到Exception 如下:


开始测试的时候,没有注意类型要一致,用了List类型,结果就出现了
org.hibernate.exception.SQLGrammarException: could not initialize a collection

在Department中 尽量不用List作为集合的类型,原因如下:
lists are indexed collections and therefor need a index column

读书人网 >软件架构设计

热点推荐