Spring、SpringMVC、Hibernate整合,操作集合出现Found shared references to a collection问题解决方案

Spring、SpringMVC、Hibernate整合,操作集合出现Found shared references to a collection问题解决方案

Found shared references to a collection:发现集合共享引用;(这是百度翻译的意思)

它这句话的意思就是说,同一个集合被多次引用。在hibernate的reference中,是不允许这样的,解决方案就是重新声明一个集合,把数据转储之后,再设置进去即可。