MYBATIS共15篇
SpringMVC框架整合Mybatis配置多个数据库-Ddmit

SpringMVC框架整合Mybatis配置多个数据库

环境 Spring:3.1; Mybatis:3.1; 数据库:我这里是不存在主从关系的、相互独立的两个oracle数据库; 需求 系统本身是Oracle数据库,但是系统中的个别功能是查询另外的数据库(我这里是echarts...
ddmit的头像-DdmitDdmit6年前
01.2W+1
Maven配置之MyBatis Generator Maven Plugin(三步学会使用MyBatis Generator生成代码)-Ddmit

Maven配置之MyBatis Generator Maven Plugin(三步学会使用MyBatis Generator生成代码)

学习使用Maven Mybatis插件MyBatis Generator Maven Plugin自动生成实体类、Example类等详细配置。 开发环境:IntelliJ IDEA 2018.3 1.添加插件依赖 插件依赖如下: <plugin> <groupId...
ddmit的头像-DdmitDdmit6年前
041990
MyBatis Generator生成代码报错:Table configuration with catalog null-Ddmit

MyBatis Generator生成代码报错:Table configuration with catalog null

使用MyBatis Generator生成代码报错信息如下: [WARNING] Table configuration with catalog null, schema xe, and table SR_CLASS did not resolve to any tables 数据库是oracle,错误原因是...
ddmit的头像-DdmitDdmit6年前
041220
Mybatis中if判断的正确使用方式(mybatis的if判断真是坑)-Ddmit

Mybatis中if判断的正确使用方式(mybatis的if判断真是坑)

Mybatis中if判断的正确使用方式整理如下: 1.Mybatis使用if判断单个字符相等 示例: 比如要判断类型等于'1' 正确方式: <if test='type == '1''> 或者 <if test='type == '1'.toString...
ddmit的头像-DdmitDdmit6年前
033580
mybatis generator自动生成代码插件example类设置order by排序字段-Ddmit

mybatis generator自动生成代码插件example类设置order by排序字段

使用Mybatis generator代码自动生成插件生成的example类如何设置排序字段呢? 设置排序字段的代码如下: Example example = new Example(MessageSend.class); example.setOrderByClause('SEND_T...
ddmit的头像-DdmitDdmit6年前
029870
Mybatis查询集合遍历出错,如何正确使用foreach判断空或null?-Ddmit

Mybatis查询集合遍历出错,如何正确使用foreach判断空或null?

Mybatis动态SQL的另一个常见使用场景是对集合进行遍历(尤其是在构建 IN 条件语句的时候),可以将List、Set、数组等类型的数据作为参数。但是当List作为参数时,判断空需要特别注意。 例如: &...
ddmit的头像-DdmitDdmit5年前
028091
Mybatis There is no getter for property 解决-Ddmit

Mybatis There is no getter for property 解决

mybatis查询出错: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'tableName' in 'class java.lang.String' 出错原因 具体...
ddmit的头像-DdmitDdmit5年前
022120
ibatis/mybitis打印sql配置-Ddmit

ibatis/mybitis打印sql配置

配置方式分为log4j.propertis和log4j.xml两种,分别将下列内容添加到log4j配置文件中即可。 1.log4j.properties配置 log4j.rootLogger=INFO,STDOUT #控制台部分 log4j.appender.STDOUT=org.apac...
ddmit的头像-DdmitDdmit6年前
022100
MyBatis Generator Example用法-Ddmit

MyBatis Generator Example用法

具体生成Example类的方法参见:Maven配置之MyBatis Generator Maven Plugin(三步学会使用MyBatis Generator生成代码); 参考文章: [mybatis]Example的用法 ; mybatis generator生成 example类...
ddmit的头像-DdmitDdmit6年前
021300
Spring Boot将Mybatis返回结果转为驼峰的三种实现方式-Ddmit

Spring Boot将Mybatis返回结果转为驼峰的三种实现方式

我们通常获取Mybatis返回的数据结果时想要将字段以驼峰的形式返回,比如ORGAN_NAME数据库字段,然后以organName的形式返回,具体实现方式有以下三种: 一、使用Mybatis内置配置 具体yml文件配置...
ddmit的头像-DdmitDdmit5年前
020260