Hi ,
I have the iBatis SQL Id using which I need to get the corresponding SQL Statement.
So I have written the below code . as of now this code seems to be working. but just want to know whether my approach is correct ?
SqlMapExecutorDelegate delegate = sqlMapClient.getDelegate();
MappedStatement mappedStatement = delegate.getMappedStatement(sqlId);
Sql sql = mappedStatement.getSql();
SessionScope sessionScope = new SessionScope();
StatementScope statementScope = new StatementScope(sessionScope);
mappedStatement.initRequest(statementScope);
String sqlExecuted = sql.getSql(statementScope,object);