For some implementations of UserType we are able to access the entity or "owner" in nullSafeGet, which is great.
But could we possibly access the entity or "owner" in nullSafeSet as well at some point?
In my case, I need to set the value of a column, given the value of a sibling property, as well as to get the classname of the entity itself. If I had access to the entity directly here that would be great.
Otherwise, what I can see is that the entity exists in the SessionImplementor -> PersistenceContext but I would need to do a lot of digging and (and possibly some reflection) in order to retrieve it. I also see that inside the PersistenceContext there are potentially multiple entities which means I wouldn't know which one I am actually looking for... |
|