Giter Club home page Giter Club logo

Comments (4)

nieqiurong avatar nieqiurong commented on August 19, 2024

lambdaQueryWrapper1.columnToString(field) 将lambda转为字段.

from mybatis-plus.

ZhangJunGuo1 avatar ZhangJunGuo1 commented on August 19, 2024

columnToString我这个版本里面没有这个方法

from mybatis-plus.

nieqiurong avatar nieqiurong commented on August 19, 2024

image

from mybatis-plus.

ZhangJunGuo1 avatar ZhangJunGuo1 commented on August 19, 2024

感谢您的解答,这个问题已经解决了;
方案如下:
AbstractWrapper.columnsToString()的修饰符是protected,不能直接被我使用;
具体代码如下:
LambdaQueryWrapper<User> lambdaQueryWrapper1 = new LambdaQueryWrapper<>(); lambdaQueryWrapper1.allEq((field, value) -> { LambdaMeta meta = LambdaUtils.extract(field); String fieldName = PropertyNamer.methodToProperty(meta.getImplMethodName()); System.out.println(fieldName+","+value); return fieldName.contains("a"); },Map.of(User::getId, 1, User::getName, "老王")).eq(User::getAge, null); userMapper.selectList(lambdaQueryWrapper1);
日志输出:
name,老王 id,1 [2024-07-07 10:27:45.415][http-nio-8080-exec-8][DEBUG]- org.apache.ibatis.logging.jdbc.BaseJdbcLogger.debug(BaseJdbcLogger.java:135) - ==> Preparing: SELECT id,name,age,email,gender,status,create_time,update_time,deleted,other_info FROM user1 WHERE deleted=0 AND (name = ? AND age = ?) [2024-07-07 10:27:45.416][http-nio-8080-exec-8][DEBUG]- org.apache.ibatis.logging.jdbc.BaseJdbcLogger.debug(BaseJdbcLogger.java:135) - ==> Parameters: 老王(String), null

from mybatis-plus.

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.