MyBatis数据库逆向生成工具

使用Mybatis数据库逆向生成工具

1.在pom中引入通用mapper工具

    <!-- 通用mapper逆向工具 -->
        <dependency>
            <groupId>tk.mybatis</groupId>
            <artifactId>mapper-spring-boot-starter</artifactId>
            <version>1.2.4</version>
        </dependency>

2.在yml中引入mapper的配置

############################################################
#
# mybatis mapper 配置
#
############################################################
# 通用 Mapper 配置
mapper:
  mappers: com.saddam.my.mapper.MyMapper
  not-empty: false    # 在进行数据库操作的的时候,判断表达式 username != null, 是否追加 username != ''
  identity: MYSQL

3.引入MyMapper接口类

/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2014-2016 abel533@gmail.com
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

package com.saddam.my.mapper;

import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;

/**
 * 继承自己的MyMapper
 */
public interface MyMapper<T> extends Mapper<T>, MySqlMapper<T> {
}

相关推荐

  1. MyBatis数据库逆向生成工具

    2024-04-03 04:54:03       11 阅读
  2. Mybatis逆向工程

    2024-04-03 04:54:03       41 阅读
  3. spring和Mybatis逆向工程

    2024-04-03 04:54:03       7 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-04-03 04:54:03       16 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-04-03 04:54:03       16 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-04-03 04:54:03       15 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-04-03 04:54:03       18 阅读

热门阅读

  1. 20款高级 Python 装饰器

    2024-04-03 04:54:03       11 阅读
  2. es6中的Object.assign

    2024-04-03 04:54:03       16 阅读
  3. 黑客攻击自己上班的公司会怎样?

    2024-04-03 04:54:03       13 阅读
  4. vue3的ref和reactive对比

    2024-04-03 04:54:03       18 阅读
  5. Android compose 使用指纹验证

    2024-04-03 04:54:03       16 阅读
  6. maya 遍历所有子节点

    2024-04-03 04:54:03       13 阅读
  7. 关于Kafka消息队列的深入学习

    2024-04-03 04:54:03       15 阅读
  8. 蓝桥杯_数学模板

    2024-04-03 04:54:03       14 阅读