I\'m trying to get the old entity in a @HandleBeforeSave event.
@Component
@RepositoryEventHandler(Customer.class)
public class CustomerEventHan
I had the same problem, but I wanted the old entity available in the save(S entity) method of a REST repository implementation (Spring Data REST).
What I did was to load the old entity using a 'clean' entity manager from which I create my QueryDSL query:
@Override
@Transactional
public S save(S entity) {
EntityManager cleanEM = entityManager.getEntityManagerFactory().createEntityManager();
JPAQuery query = new JPAQuery(cleanEM);
//here do what I need with the query which can retrieve all old values
cleanEM.close();
return super.save(entity);
}