Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
20.8k views
in Technique[技术] by (71.8m points)

关于处理数据库时分层

在管理数据库时,通常会有一些默认的保留字段,比如

  1. gmt_created,使用一个统一的逻辑更新,不必关心具体业务如何,只要设计insert即自动加上
  2. gmt_modified,只要设计update即自动同步更新
  3. is_deleted,自动在where中加入is_deleted = 0

类似这样的,有没有一些方式,使用一些标志把mapper分层,不加以说明的话,自动加上这些限制。也就是下层规定这些限制,上层在写sql时不需要考虑这些字段的限制?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

mybatis-plus


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...