mybatis
Mickey的大米
这个作者很懒,什么都没留下…
展开
-
mybatis中的配置文件(maven工程)
大概布局pom.xml<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/mave原创 2021-07-06 13:39:21 · 109 阅读 · 0 评论 -
mybatis关于动态SQL语句
mybatis动态SQL语句,主要的元素有ifchoose(when,otherwise)trimwheresetforeach接下来看看它们的使用在mapper下创建接口类DynamicSqlimport org.example.beans.User;import java.util.List;public interface DynamicSql { /*if*/ List<User> getAll(User user); //choos原创 2021-07-06 13:29:27 · 85 阅读 · 0 评论 -
MyBatis逆向工程代码的生成
在pom.xml文件中添加插件 <!--逆向工程插件--> <plugin> <groupId>org.mybatis.generator</groupId> <artifactId>mybatis-generator-maven-plugin</artifactId> <version>1.3.2</version> <原创 2021-07-06 13:16:23 · 124 阅读 · 0 评论 -
mybatis中Pagehelper插件实现数据分页
mybatis中Pagehelper插件实现数据分页在pom.xml中导入分页依赖 <dependency> <groupId>com.github.pagehelper</groupId> <artifactId>pagehelper</artifactId> <version>4.1.6</version> </dependency>mybatis配置原创 2021-07-06 13:04:12 · 71 阅读 · 0 评论 -
mybatis中的别名处理
mybatis中的别名处理在mybatis配置文件src/main/resource目录下mybatis-config.xml中添加一种即可。<!--别名处理--> <typeAliases> <!--第一种 type指向需要定义的类 alias指向自定义的别名--> <typeAlias type="org.example.bean.User" alias="user"></typeAlias>原创 2021-07-06 12:55:49 · 223 阅读 · 0 评论 -
maven工程mabatis框架实现log4j日志功能
maven工程mabatis框架实现log4j日志功能在mybatis配置文件src/main/resource目录下mybatis-config.xml中导入日志依赖 <!--日志依赖--> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.12</v原创 2021-07-06 12:43:08 · 47 阅读 · 0 评论 -
使用maven搭建mybatis坏境
使用maven搭建mybatis坏境pom.xml文件的构建,导入mysql与mabatis相关依赖<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM原创 2021-07-06 12:28:56 · 54 阅读 · 0 评论