title: Maintaining entity row version/history manually in database table using JPA/hibernate
body: <p>I don't know where to ask this question or how to ask. Basically what I need that I have  couple of entity classes and if I think in terms of database table , each row will have a specific column like 'S0' which will indicate the current state of the application.My application will fetch data based on 'S0' by default from all the tables(where history='S0' by default).</p>
  
  <p>When I need a history , I fetch all rows where history column = 'S0' and insert new row with value ='S1' having other properties exactly same (except the identity as it changes while inserting). Next time like 'S2' like so on. The S0 rows will remain the same.</p>
  
  <p>My application should have the option to load/populate  itself by selecting archived data. like load app with history S1</p>
  
  <p>How Do I manage this with JPA+Hibernate. in JDBC+JSP I used to have a column history on each table and handle this manually:copy and insert all. But it is a hazard and not good practice I think.</p>
  
  <p>Please help me by giving me some advice /help. </p>