SSM项⽬打印执⾏的sql语句
在ssm项⽬中,只需要在l配置中添加⼀个tting即可。
七年级上册古诗<!-- 打印查询语句 -->
<tting name="logImpl" value="STDOUT_LOGGING" />
下⾯贴⼀下我的整个l配置⽂件,供参考。
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE configuration PUBLIC "-////DTD Config 3.0//EN" "/dtd/mybatis-3-config.dtd">
<configuration>
<!-- 配置mybatis的缓存,延迟加载等等⼀系列属性 -->
<ttings>雏鹰展翅武术体操
<!-- 全局映射器启⽤缓存 -->
<tting name="cacheEnabled" value="true"/>
<!-- 查询时,关闭关联对象即时加载以提⾼性能 -->
<tting name="lazyLoadingEnabled" value="true"/>
<!-- 对于未知的SQL查询,允许返回不同的结果集以达到通⽤的效果 -->
<tting name="multipleResultSetsEnabled" value="true"/>
<!-- 允许使⽤列标签代替列名 -->
<tting name="uColumnLabel" value="true"/>
<!-- 不允许使⽤⾃定义的主键值(⽐如由程序⽣成的UUID 32位编码作为键值),数据表的PK⽣成策略将被覆盖 -->
<tting name="uGeneratedKeys" value="fal"/>
<!-- 给予被嵌套的resultMap以字段-属性的映射⽀持 FULL,PARTIAL -->
<tting name="autoMappingBehavior" value="PARTIAL"/>
<!-- Allows using RowBounds on nested statements -->
猕猴桃果汁>上胸
<tting name="safeRowBoundsEnabled" value="fal"/>
红烧鲍鱼的家常做法
<!-- Enables automatic mapping from classic databa column names A_COLUMN to camel ca classic Java property names aColumn. -->
<tting name="mapUnderscoreToCamelCa" value="true"/>
<!-- MyBatis us local cache to prevent circular references and speed up repeated nested queries.
By default (SESSION) all queries executed during a s ession are cached. If localCacheScope=STATEMENT
local ssion will be ud just for statement execution, no data will be shared between two different calls to the same SqlSession. -->
<tting name="localCacheScope" value="SESSION"/>
<!-- Specifies the JDBC type for null values when no specific JDBC type was provided for the parameter. Some drivers require specifying the column JDB C type but others work with generic values
宁夏中卫沙坡头like NULL, VARCHAR or OTHER. -->女人吃当归的禁忌
<tting name="jdbcTypeForNull" value="OTHER"/>
<!-- Specifies which Object's methods trigger a lazy load -->
刘慧凝<!-- Specifies which Object's methods trigger a lazy load -->
<tting name="lazyLoadTriggerMethods" value="equals,clone,hashCode,toString"/>
<!-- 设置关联对象加载的形态,此处为按需加载字段(加载字段由SQL指定),不会加载关联表的所有字段,以提⾼性能 --> <tting name="aggressiveLazyLoading" value="fal"/>
<tting name="logImpl" value="STDOUT_LOGGING"/>
<tting name="logImpl" value="LOG4J"/>
<!-- 打印查询语句 -->
<tting name="logImpl" value="STDOUT_LOGGING" />
</ttings>
<typeAlias>
<!-- 注:model表对象配置,请按照 model 包中的顺序进⾏录⼊,并做好注释. -->
</typeAlias>
<plugins>
<plugin interceptor="com.github.abel533.mapperhelper.MapperInterceptor">
<!--主键⾃增回写⽅法,默认值MYSQL,详细说明请看⽂档 -->
<property name="IDENTITY" value="MYSQL" />
<!--通⽤Mapper接⼝,多个通⽤接⼝⽤逗号隔开 -->
<property name="mappers" value="com.github.abel533.mapper.Mapper" />
</plugin>
</plugins>
</configuration>
2019.8.29更新
如果是使⽤Idea操作Mybatis,
这⾥推荐⼀款插件:
可以点进我的另⼀篇博客具体查看⼀下。
使⽤了这款插件之后。就可以打开⼀个单独的窗⼝显⽰完整的sql(不是带占位符的那种)。