Hibernate 多对一的 实现
在一对多的问题中遇到Exception 如下:
开始测试的时候,没有注意类型要一致,用了List类型,结果就出现了org.hibernate.exception.SQLGrammarException: could not initialize a collection
在Department中 尽量不用List作为集合的类型,原因如下:
lists are indexed collections and therefor need a index column