Haven't tried, but falling back to the hibernate session should work:
This works for me, thanks!
This is very close to the answer I am looking for as well, except for one thing. I want to know if a specific entity is dirty. I've got several different entities managed by the same entityManager and I have a need to know if one of the entities is dirty (in order to put up a confirmation dialog when the user attempts to navigate to a different entity).
have you looked on the Hibernate forum? I just scanned the Hibernate Session API here:
and didn't see any methods that would be applicable.
maybe this would work:
If you know which entity you're interested in checking then do this:
EquipmentRepair equipmentRepair = entityManager.find(EquipmentRepair.class, repairId);
then compare all the properties of the entity's class with the values of the potentially dirty copy of the entity in the SMPC for the injected EntityManager. I'm not sure how to get the instance of an entity that is currently being managed by the EntityManager in SMPC. Is there an API for this in JPA or Hibernate???
This would basically require access to entities in the first-level cache...