java - Hibernate interceptor, onPrepareStatement(),try to "read" the value of the prepared statement SQL string -
i have question on interceptor class of hibernate, want read string of sql returned method onpreparestatement of custom interceptor on hibernate, or read array of value of record sql called list<t> list = criteria.list(); before invocation of method "getentity()" of interceptor class, this:
public string onpreparestatement(string sql) { system.out.println("onpreparestatement: called statement: " + sql); //the sql in input this: //onpreparestatement: called statement: //select this_.doc_id doc_id1_1_0_, this_.city city2_1_0_ //for java object obj(integer doc_id,string city); //what want read->modify->return sql hibernate: //[read]select "doc_id" doc_id1_1_0_, "city" city2_1_0_ //[modify]select "doc_id2" doc_id1_1_0_, "city2" city2_1_0_ //[return]select this_.doc_id doc_id1_1_0_, this_.city city2_1_0_ return sql; } i know prepared statement , can't capture actual value of columns, have shown example give idea of need do. ty in advance help.
Comments
Post a Comment