zoukankan      html  css  js  c++  java
  • spring boot之mybatis配置

    配置在application.yml文件中

    mybatis-plus:
      # 如果是放在src/main/java目录下 classpath:/com/yourpackage/*/mapper/*Mapper.xml
      mapper-locations: classpath:/com/bonc/flsz/**/mapping/*.xml
      #实体扫描,多个package用逗号或者分号分隔
      typeAliasesPackage: com.bonc.flsz.*.model
      global-config:
        #主键类型  0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
        id-type: 1
        #字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
        field-strategy: 2
        #驼峰下划线转换
        db-column-underline: true
      configuration:
        map-underscore-to-camel-case: true
        cache-enabled: true #配置的缓存的全局开关
        lazyLoadingEnabled: true #延时加载的开关
        multipleResultSetsEnabled: true #开启的话,延时加载一个属性时会加载该对象全部属性,否则按需加载属性
        log-impl: org.apache.ibatis.logging.stdout.StdOutImpl #打印sql语句,调试用

     pom里的配置

    在<build>中

    <resources>
    <resource>
    <directory>src/main/resources</directory>
    </resource>

    <resource>
    <directory>src/main/java</directory>
    <filtering>false</filtering>
    <includes>
    <include>**/*.xml</include>
    </includes>
    </resource>
    </resources>
  • 相关阅读:
    Dangling Javadoc comment
    IntelliJ IDEA :Error(1, 1) java 非法字符 'ufeff'
    什么是webhook
    智能DNS
    filebeat 乱码
    windows,交换机syslog收集
    Rsyslog
    ntp
    centos7 -lvm卷组
    nginx安装
  • 原文地址:https://www.cnblogs.com/cailijuan/p/9109205.html
Copyright © 2011-2022 走看看