Debugging and printing SQL using idea breakpoint

Time:2022-5-20

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

findSqlSessionTemplateClass, inSqlSessionTemplateofinvoke()Break points in the method, as shown in the following figure:

Debugging and printing SQL using idea breakpoint

Debugging and printing SQL using idea breakpoint

Debugging and printing SQL using idea breakpoint

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

Recommended Today

UI automation test: Selenium + Po mode + pytest + allure integration

本人目前工作中未涉及到WebUI自动化测试,但为了提升自己的技术,多学习一点还是没有坏处的,废话不多说了,目前主流的webUI测试框架应该还是selenium,考虑到可维护性、拓展性、复用性等,我们采用PO模式去写我们的脚本,本文档也主要整合了Selenium+PO模式+Pytest+Allure,下面我们进入正题。注:文章末尾附Github地址 技术前提:python、selenium、pytest基础知识 1. 项目结构目录: image.png 2. PO模式介绍 PO模式特点: 易于维护 复用性高 脚本易于阅读理解 PO模式要素: 1. 在PO模式中抽象封装成一个BasePage类,该基类应该拥有一个只实现 webdriver 实例的属性 2. 每个一个 pag 都继承BasePage,通过driver来管理本page中元素将page中的操作封装成一个个的方法 3. TestCase依赖 page 类,从而实现相应的测试步骤 2019062515512657.png 3. BasePage 页面封装 import logging import os import time from datetime import datetime from time import sleep from selenium import webdriver from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.wait import […]