Debug breakpoint to view the SQL statement generated by mybatis
In the mybatis database configuration scenario, you sometimes need to view the specific generated mybatis SQL to facilitate debugging. You can enable log printing, but the most convenient way is to view it directly. The following describes the specific breakpoint location and how to view the generated SQL.
1. Place a breakpoint in the invoke function diagram of sqlsessiontemplate
findSqlSessionTemplate
Class, inSqlSessionTemplate
ofinvoke()
Break points in the method, as shown in the following figure:
2. When the breakpoint is reached, open the view on the far right of the key value of variable cache in the debugging window of idea, as shown in the figure, and you can see the generated SQL
This work adoptsCC agreement, reprint must indicate the author and the link to this article