title: Hibernate interceptor, onPrepareStatement(),try to "read" the value of the prepared statement SQL string
body: <p>i have a question on the interceptor class of hibernate, i want to read the string of a SQL returned from the method onPrepareStatement of a custom interceptor on hibernate, or read the array of value of the record sql called from a <code>List&lt;T&gt; list =  criteria.list();</code> before the invocation of the method "getEntity()" always of the interceptor class, like this:</p>
  
  <pre><code>public String onPrepareStatement(String sql) {
      System.out.println("onPrepareStatement: Called for statement: " + sql);
      //The SQL in input is like this:
      //onPrepareStatement: Called for statement:     
      //select this_.doc_id as doc_id1_1_0_, this_.city as city2_1_0_
  
      //for a java object Obj(Integer doc_id,String city);
  
      //What i want is read-&gt;modify-&gt;return the SQL to Hibernate:
  
      //[READ]select "doc_id" as doc_id1_1_0_, "city" as city2_1_0_    
      //[MODIFY]select "doc_id2" as doc_id1_1_0_, "city2" as city2_1_0_
      //[RETURN]select this_.doc_id as doc_id1_1_0_, this_.city as city2_1_0_
      return sql;
  }
  </code></pre>
  
  <p>I know is a prepared statement and i can't capture the actual value of the columns, But I have shown this example just to give an idea of what I need to do. 
  Ty in advance for any help.</p>