Git Product home page Git Product logo

Comments (10)

brianway avatar brianway commented on May 25, 2024

注解方式?能具体点吗?

from springmvc-mybatis-learning.

bestfc avatar bestfc commented on May 25, 2024

这个列子展示了多参数使用@sqlProvider:

@SelectProvider(type = UserSqlBuilder.class, method = "buildGetUsersByName")
List getUsersByName(
@param("name") String name, @param("orderByColumn") String orderByColumn);

class UserSqlBuilder {

// If not use @param, you should be define same arguments with mapper method
public String buildGetUsersByName(
final String name, final String orderByColumn) {
return new SQL(){{
SELECT("*");
FROM("users");
WHERE("name like #{name} || '%'");
ORDER_BY(orderByColumn);
}}.toString();
}

// If use @param, you can define only arguments to be used
public String buildGetUsersByName(@param("orderByColumn") final String orderByColumn) {
return new SQL(){{
SELECT("*");
FROM("users");
WHERE("name like #{name} || '%'");
ORDER_BY(orderByColumn);
}}.toString();
}
}

from springmvc-mybatis-learning.

bestfc avatar bestfc commented on May 25, 2024

http://www.mybatis.org/mybatis-3/zh/java-api.html
官方说明算是一笔带过,比较粗糙

from springmvc-mybatis-learning.

brianway avatar brianway commented on May 25, 2024

懂了,我也不知道企业现在主要是用 xml 还是注解,如果注解是趋势的话,我有空写一写。如果 xml 是趋势,那就不写了。我暑假看看

from springmvc-mybatis-learning.

wangshuai12345 avatar wangshuai12345 commented on May 25, 2024

老哥,你这不是原创啊

from springmvc-mybatis-learning.

imooni avatar imooni commented on May 25, 2024

是啊,我点赞的

from springmvc-mybatis-learning.

brianway avatar brianway commented on May 25, 2024

学习笔记性质的文章,大家看的都是一个教程,写不出花来啊,大兄弟。

from springmvc-mybatis-learning.

1330212641 avatar 1330212641 commented on May 25, 2024

学习笔记性质的文章,大家看的都是一个教程,写不出花来啊,大兄弟。

相较之下,小白两者都喜欢。教程式的用来敲借鉴。笔记式的用来理思绪。

from springmvc-mybatis-learning.

zc-cris avatar zc-cris commented on May 25, 2024

from springmvc-mybatis-learning.

ujavance avatar ujavance commented on May 25, 2024

from springmvc-mybatis-learning.

Related Issues (18)

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.