hibernate insert to a collection causes a delete then all the items in the collection to be inserted again

后端 未结 7 1682
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-17 21:09

I have a many to may relationship CohortGroup and Employee. Any time I insert an Employee into the CohortGroup hibernate deletes the group from the resolution table and ins

7条回答
  •  别那么骄傲
    2020-12-17 21:55

    As others have suggested, it's probably a problem with hashcode or equals.

    Specifically: Hibernate proxies cause problems with instaceof which you are using in your equals method. That spells bad news.

    Check this out: http://community.jboss.org/wiki/ProxyVisitorPattern

提交回复
热议问题