We have some entities where we use a custom entity-name, other than the class name. Before version 5.2 we were able to call SessionImpl.refresh() with the entity name and the entity:
session.refresh(“CustomName”, obj)
After some research, I found a possible cause for this behavior. Since 5.2.0, there are two implementations of the SessionImpl.contains() method. One without and one with an additional parameter for the entity name. And the DefaultRefreshEventListener is using the one with the object only. Therefore, the given entity name is no longer used. I have attached a simple test case to reproduce this error. |