Giter VIP home page Giter VIP logo

Comments (6)

hengboy avatar hengboy commented on August 15, 2024

@randeexiong 跟mybatis的xml方式使用是不会影响的,这个问题应该是你配置的扫描xml位置存在问题

from api-boot.

randeexiong avatar randeexiong commented on August 15, 2024

我新建了一个项目,最开始只使用mybatis是可以的,但一加上ApiBoot Mybatis Enhance依赖,其他内容没有任何更改的情况下,就会
报错Invalid bound statement (not found)

from api-boot.

hengboy avatar hengboy commented on August 15, 2024

每一个依赖都有独特的配置文件做支持,虽然有默认的配置,但是不一定能满足你的项目结构

from api-boot.

randeexiong avatar randeexiong commented on August 15, 2024

用的是最简单的 mybatis-starter 的配置,没有其他依赖

from api-boot.

hengboy avatar hengboy commented on August 15, 2024

这种都是项目开发中的最基本问题,你先把application.yml贴出来吧

from api-boot.

randeexiong avatar randeexiong commented on August 15, 2024
spring:
  profiles:
    active: dev
  mvc:
    converters:
      preferred-json-mapper: fastJson
  servlet:
    multipart:
      enabled: true
      max-file-size: 30MB
      max-request-size: 30MB
server:
  port: 123456


mybatis:
  type-aliases-package: org.minbox.framework.api.boot.cbrc.stateverify.entity
  mapper-locations:
    - classpath:mapper/*.xml
  configuration:
    map-underscore-to-camel-case: true 
# ====================== #
# ======开发环境配置====== #
# ====================== #

# 数据库配置
# 数据源配置
spring:
  #druid数据源连接池,和pom配合使用,5项
  datasource:
    druid:
      driver-class-name: com.mysql.cj.jdbc.Driver
      url: jdbc:mysql://localhost:3306/database1?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
      username: root
      password: root
      initialSize: 5
      minIdle: 5
      maxActive: 20
      maxWait: 60000
      timeBetweenEvictionRunsMillis: 60000
      minEvictableIdleTimeMillis: 300000
      validationQuery: SELECT 1 FROM DUAL
      testWhileIdle: true
      testOnBorrow: false
      testOnReturn: false
      poolPreparedStatements: true
      #   配置监控统计拦截的filters,stat:监控统计、Log4j:日志记录、wall:防御sql注入
      # filters: stat,wall,log4j
      maxPoolPreparedStatementPerConnectionSize: 20
      useGlobalDataSourceStat: true
      connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500
      # 通过 connection-properties 属性打开 mergeSql 功能;慢 SQL 记录
      filter:
        wall:
          enabled: true
        stat:
          enabled: true
          log-slow-sql: true
          slow-sql-millis: 10000
          merge-sql: true
        # 配置 DruidStatFilter
      web-stat-filter:
        enabled: true
        url-pattern: /*
        session-stat-enable: true
        profile-enable: true
        exclusions: '*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*'
      # 配置 DruidStatViewServlet
      stat-view-servlet:
        enabled: true
        # IP 白名单,没有配置或者为空,则允许所有访问
        allow:
        # IP 黑名单,若白名单也存在,则优先使用
        deny:
        # 禁用 HTML 中 Reset All 按钮
        reset-enable: false
        # 登录用户名/密码
        login-username: root
        login-password: 123
      aop-patterns: com.druid.*



logging:
  level:
    org.minbox.framework.api.boot.cbrc.stateverify: debug

当不添加 api-boot-starter-mybatis-enhance 依赖是可以正常使用的,当添加 api-boot-starter-mybatis-enhance 依赖再去访问服务读取数据,将致可用的使用xml方式的mybaits,报错 Invalid bound statement (not found)

from api-boot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.