Giter VIP home page Giter VIP logo

Comments (10)

devpage avatar devpage commented on June 29, 2024 1

学习了,很好的资源

from spring-cloud-rest-tcc.

prontera avatar prontera commented on June 29, 2024

@Mrshengjie 您看得很仔细,这个Aspect正是用于字段校验。

from spring-cloud-rest-tcc.

Mrshengjie avatar Mrshengjie commented on June 29, 2024

@prontera 我记得 controller中带的@Valid这对应的校验,是否就能满足?

from spring-cloud-rest-tcc.

Mrshengjie avatar Mrshengjie commented on June 29, 2024

您的项目我看也封装了超级CrudMapper,如果遇到关系表联表查询,对象可能不是单纯的数据库列对应domain里的User对象,比如会在User的基础上加上另一个对象,您怎么处理? mybatis不像hibernate,对象间的关系都是用对象,mybatis用MBG生成的都是ID.这样关系对象如何处理,问题比较弱智,见笑了.

from spring-cloud-rest-tcc.

prontera avatar prontera commented on June 29, 2024

CrudMapper仅是简单的辅助工具,如果需要级联查询依然是需要手工编写Mapping,按照我的习惯个人更加倾向于多个Mapper之间的数据“整合”,而不是在Mapping中编写级联查询,这样能让代码变得更为通用。

from spring-cloud-rest-tcc.

Mrshengjie avatar Mrshengjie commented on June 29, 2024

有相关您写的案例吗?我学习一下,我也想代码通用一点,看起来不那么杂乱,mybatis也是刚用.请多指教.....

from spring-cloud-rest-tcc.

prontera avatar prontera commented on June 29, 2024

@Mrshengjie 本示例就已经是一个案例,对于MyBatis的初学者建议自己练习写一两个小项目,这样才能更加有体会。

from spring-cloud-rest-tcc.

Mrshengjie avatar Mrshengjie commented on June 29, 2024

@prontera 我的意思是用您这种通CrudMapper,再多表联合查询的...想学习一下您说的通用点的写法.

from spring-cloud-rest-tcc.

prontera avatar prontera commented on June 29, 2024

@Mrshengjie 其实我这种也不算是通用Mapper,因为映射文件连该有的依然要有。当时在学习MyBatis的时候有看过一种真正可通用的,曾经叫做tkMapper,现在貌似已经改名了,直通车在这里

from spring-cloud-rest-tcc.

Mrshengjie avatar Mrshengjie commented on June 29, 2024

@prontera 这个我之前看过.感谢.

from spring-cloud-rest-tcc.

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.