generating sql queries from mybatis xml queries generating sql queries from mybatis xml queries sql sql

generating sql queries from mybatis xml queries


Inetractive applicationIn your place I would use some sort of load generator, record a macro on Selenium for example with some imputs clicking everywhere that could be clicked on your application so that the targeted SQLs are triggered. Then I would put one recorder to log and dump all the SQL queries. I will analyse the log , pick up all the different samples and run them against the DB with explain plan.

Its a bit of a workaround solution , but I believe it will do the trick.

For a non interactive application, where UI or SOAP or REST recording is not an option. For exaple some sort of networking based application or a batch application or whatever.... If we suppose it is a batch, I would just let it play record the SQLs and again do explain. A lot of databases can do that on the fly actualy. For example if you use "Query monitor" on DB2 it records all queries in certain timeframe and than you can see the heaviest ones, or just the most commonly occuring ones and do explain. My expectation is other databases may have similar functionality if not you just dump the sqls on the application side. Plenty of options there http://www.rgagnon.com/javadetails/java-0602.html