Gavin,
possibly, there is a bug regarding the property-ref attribute of one-to-one associations and the caching of entities ...
Consider two entities A and B with each having it's own id.
As far, as I understood, starting from 2.1 we can define a proptery, which is not the id, to make the association.
So, entity B contains a property (let's sax id_of_a), which contains the id of A, I used the property-ref to define this.
Everything works fine until you switch on caching ...
The first access works well, but the second one does not, because Hibernate tries to look up the B entitiy for a paticular A entity with the id of the B entity, not the value of the id_of_a property.
Do you understand?
I guess, that the cache look-up stuff is not aware of the property-ref settings ...
Here is the corresponding query: select distinct a from ABean a, a.bee b
Thanx
|