Hey,
Although it looks like a real simple question, I want to ensure I’ve chosen the best solution.
I’ve two Classes A and B and which has reference to the same(!) instance of class C.
The cascade type of C in both A and B, includes cascade.persist.
In my test, I’ve created instance of A and an instance of B, as commented before-
Both instances reference the same instance of C.
I’ve saved A and B’s instances, and of course although A and B were referencing the same C,
The C instance got two different orm-id (one in A’s hierarchy, and on in B’s).
My solution was to persist C first and then set A’s C and B’s C to be my instance.
Any better idea?
|