V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
zmz980126
V2EX  ›  MySQL

关于 mybatis 的 xml 路径问题

  •  
  •   zmz980126 · Aug 5, 2019 · 4440 views
    This topic created in 2463 days ago, the information mentioned may be changed or developed.

    大概是这样的,IDEA 上搭建的一个项目,src 下有 main,test 两个文件夹,两个都有 resources.common.mapper.xxxMapper.xml(xxx 为代指),两个文件 copy relative path 得到的结果是一样的,然后我再 test 的 mapper 下写了一个 select 实现,main 没写,然后通过生成 test 测试,通过,然后我公司的前辈告诉我要在 main 下写,于是把 test 下的那个 select 剪切到 main 下,test 测试报错,然后把 test 下的那个 xml 删掉,他又测试通过了... 谁能告诉我这是怎么回事?

    2 replies    2019-08-05 18:37:15 +08:00
    Aruforce
        1
    Aruforce  
       Aug 5, 2019
    connectionFactory 指定文件路径....
    Aruforce
        2
    Aruforce  
       Aug 5, 2019   ❤️ 1
    @Aruforce
    append #1

    org.apache.ibatis.session.defaults.DefaultSqlSessionFactory 这个类
    如果在和 Spring 集成的话是 org.mybatis.spring.SqlSessionFactoryBean 这个类

    你应该在用 MVN,你可以去学下 MVN 的约定目录结构什么的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   882 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 19:02 · PVG 03:02 · LAX 12:02 · JFK 15:02
    ♥ Do have faith in what you're doing.