问题:a different object with the same identifier value was already associated with the session 和Found two representations of same collection。
这种情况其实就是session中有两个相同id的持久化对象。
处理方法1:就是调用hibernate中的merger方法,将这两个对持久化对象合并成一个对象。
处理方法2:就是调用hibernate中的evit方法,将其中的一个持久话对象变成游离状态。
以上两中异常经常出现在一对多映射和多对多映射中。