title: Dump Hibernate activity to sql script file
body: <p>I'm trying to log hibernate activity (only dml operations) to an sql script file.
  My goal is to have a way to reconstruct the database from a given starting point to the current state by executing the generated script.</p>
  
  <p>I can get the sql queries from log4j logs but they have more information than the raw sql queries and i would need to parse them and extract only the helpful statements.</p>
  
  <p>So i'm looking for a programatic way, maybe by listening the persist/merge/delete operations and accessing the hibernate-generated sql statements.</p>
  
  <p>I don't like to reinvent the wheel so, if anybody know a way for doing this i would appreciate it very much.</p>
  
  <p>Thanks in advance</p>