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

2019-02-06 20:17:23 +08:00
 Sanko
9029 次点击
所在节点    问与答
10 条回复
fanfpy
2019-02-06 22:00:44 +08:00
你说的包名吗?
Foxkeh
2019-02-06 22:09:54 +08:00
你是直指的 JPA or MyBatis 吗?
maxiujun
2019-02-06 22:30:33 +08:00
Dao 是念“倒”, “刀”,“道”, 还是“捯”?有标准读法吗?
kqz901002
2019-02-06 22:36:53 +08:00
问题问的莫名其妙
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
2019-02-06 23:14:00 +08:00
@fanfpy 对,包名
@Foxkeh MyBatis,不过项目结构和这个有关系吗
@kqz901002 刚接触 springboot 请见谅,网上看了很多项目结构什么样的都有,所以前来请教
CFO
2019-02-07 02:02:37 +08:00
我的 dao 文件夹里放的是 mapper …
gejun123456
2019-02-07 07:10:40 +08:00
mybatis 的话 mapper 就行罗
WispZhan
2019-02-07 17:59:45 +08:00
不同场景,用不同东西。混用又不是不行,不明白有什么好纠结的。这种帖子隔段时间就有人发
WispZhan
2019-02-07 18:04:06 +08:00
@WispZhan 我错了,都行。统一命名,定制规范就行。
类以 mapper 结尾更好。

包名都行,dao 范围更大,mapper 有局限

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/533225

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX