V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
Sanko
V2EX  ›  问与答

SpringBoot 开发中使用 Dao 还是使用 Mapper

  •  
  •   Sanko · 2019-02-06 20:17:23 +08:00 · 9010 次点击
    这是一个创建于 1876 天前的主题,其中的信息可能已经有所发展或是发生改变。
    10 条回复    2019-02-07 18:04:06 +08:00
    fanfpy
        1
    fanfpy  
       2019-02-06 22:00:44 +08:00 via Android
    你说的包名吗?
    Foxkeh
        2
    Foxkeh  
       2019-02-06 22:09:54 +08:00 via Android
    你是直指的 JPA or MyBatis 吗?
    maxiujun
        3
    maxiujun  
       2019-02-06 22:30:33 +08:00
    Dao 是念“倒”, “刀”,“道”, 还是“捯”?有标准读法吗?
    kqz901002
        4
    kqz901002  
       2019-02-06 22:36:53 +08:00
    问题问的莫名其妙
    sdijeenx
        5
    sdijeenx  
       2019-02-06 22:39:43 +08:00
    @maxiujun 字典说 Dao 就是 Tao 的别名。
    Dao | BrE daʊ | AmE |
    noun uncountable
    = Tao
    Tao | daʊ, taʊ | (also Dao)
    noun
    (in Chinese philosophy) the absolute principle underlying the universe, combining within itself the principles of yin and yang and signifying the way, or code of behavior, that is in harmony with the natural order. The interpretation of Tao in the Tao-te-Ching developed into the philosophical religion of Taoism.
    Sanko
        6
    Sanko  
    OP
       2019-02-06 23:14:00 +08:00
    @fanfpy 对,包名
    @Foxkeh MyBatis,不过项目结构和这个有关系吗
    @kqz901002 刚接触 springboot 请见谅,网上看了很多项目结构什么样的都有,所以前来请教
    CFO
        7
    CFO  
       2019-02-07 02:02:37 +08:00 via Android
    我的 dao 文件夹里放的是 mapper …
    gejun123456
        8
    gejun123456  
       2019-02-07 07:10:40 +08:00 via iPhone
    mybatis 的话 mapper 就行罗
    WispZhan
        9
    WispZhan  
       2019-02-07 17:59:45 +08:00 via Android
    不同场景,用不同东西。混用又不是不行,不明白有什么好纠结的。这种帖子隔段时间就有人发
    WispZhan
        10
    WispZhan  
       2019-02-07 18:04:06 +08:00 via Android
    @WispZhan 我错了,都行。统一命名,定制规范就行。
    类以 mapper 结尾更好。

    包名都行,dao 范围更大,mapper 有局限
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3509 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 10:51 · PVG 18:51 · LAX 03:51 · JFK 06:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.