Hi,
I am trying to find if a property has changed or not.
Here is the logic im using (ignoring null checks):
Code:
currentValue = object.getKey();
loadedValue = session.getPersistenceContext().getEntityEntry(object).getLoadedValue("key")
return !currentValue.equals(loadedValue);
This seems to work for normal properties and many-to-one relationships.
But for OneToMany/PersistentCollections, currentState and loadedState return same values.
Is this a bug?
If not, is there a better way to figure out if a Collection/Property has changed?