| Hi again, I just verified the ElementCollection and the problem is exactly the same as with @OneToMany still the same shared reference Hibernate exception. And still my fixed CollectionKey (see the zip file and the org/ folder, there is also a readme there) solves this problem. So we still have the problem here. I was thinking again about the possible solutions and I see three: *1. *Modify the CollectionKey behaviour to take the PK of collection container entity - as I did in the fix. I don't see yet any disadventages but I would guess that it might break the circular dependency detection as the comment in Collections.java:178 says:
*2. * Add an annotation which may disable the shared collection check at Collections.java:180 if a user knows what he is doing. *3. * And the last which I already mentioned: Maybe this check for shared collections at Collections.java:180 should be disabled if the involved collections are marked non insertable and non updateable. What do you think? |