title: Spring Data Rest: Tracking data changes in history tables
body: <p>I would like to track changes to my data using history tables using Spring Data Rest. My expected behavior is that for each transaction that changes data, an entry would automatically added to my history table. I am not sure, but I don't think it is valid to have transactions that span multiple requests when using services.</p>
  
  <p>I currently have 2 options for this:</p>
  
  <p>1) Use database triggers for the data - the disadvantage I see here is that currently, most of our manipulation is done through Java, and I don't see any way to do this via Java.</p>
  
  <p>2) Use Annotated event handlers - we would create event handlers for each event for each table, to track the history, I am inclined to do this, but I am not sure if this is the correct way.</p>
  
  <p>Which of the 2 options are better? Are there other options available as well?</p>