本文主要是介绍【Lazy ORM】1.2.2-JDK17-SNAPSHOT in查询优化,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
Gitee
版本信息 1.2.2-JDK17-SNAPSHOT
新增 inOr查询 防止in查询索引失效
用法
public void select() {LazyUserTest lazyUserTest = new LazyUserTest();lazyUserTest.setUsername("紧");lazyUserTest.setSex(LazyUserTest.Sex.MAN);lazyUserTest.setId(12L);lazyLambdaStream.upsert(lazyUserTest);lazyLambdaStream.update(lazyUserTest, LazyWrappers.<LazyUserTest>lambdaWrapper().eq(LazyUserTest::getSex, LazyUserTest.Sex.MAN));List<LazyUserTest> lazyUserTests = lazyLambdaStream.selectList(LazyWrappers.<LazyUserTest>lambdaWrapper().inOr(LazyUserTest::getAge, List.of(18, 19, 20)));System.out.println("18、19、20 age user:" + lazyUserTests);// 打印信息// 执行类型: =====> SELECT //执行sql: =====> SELECT lazy_user_test.birthday as birthday , lazy_user_test.sex as sex , lazy_user_test.id as id , lazy_user_test.username as username , lazy_user_test.is_deleted as is_deleted , lazy_user_test.age as age from lazy_user_test where ( lazy_user_test.age = 18 or lazy_user_test.age = 19 or lazy_user_test.age = 20 ) and is_deleted = false// 18、19、20 age user:[]}
这篇关于【Lazy ORM】1.2.2-JDK17-SNAPSHOT in查询优化的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!