title: How to get old entity value in @HandleBeforeSave event to determine if a property is changed or not?
body: <p>I'm trying to get the old entity in a <code>@HandleBeforeSave</code> event.</p>
  
  <pre><code>@Component
  @RepositoryEventHandler(Customer.class)
  public class CustomerEventHandler {
  
      private CustomerRepository customerRepository;
  
      @Autowired
      public CustomerEventHandler(CustomerRepository customerRepository) {
          this.customerRepository = customerRepository;
      }
  
      @HandleBeforeSave
      public void handleBeforeSave(Customer customer) {
          System.out.println("handleBeforeSave :: customer.id = " + customer.getId());
          System.out.println("handleBeforeSave :: new customer.name = " + customer.getName());
  
          Customer old = customerRepository.findOne(customer.getId());
          System.out.println("handleBeforeSave :: new customer.name = " + customer.getName());
          System.out.println("handleBeforeSave :: old customer.name = " + old.getName());
      }
  }
  </code></pre>
  
  <p>In the event I try to get the old entity using the <code>findOne</code> method but this return the new event. Probably because of Hibernate/Repository caching in the current session.</p>
  
  <p>Is there a way to get the old entity?</p>
  
  <p>I need this to determine if a given property is changed or not. In case the property is changes I need to perform some action.</p>