From 970ac214636cf799779c7219aaab74d228ebf075 Mon Sep 17 00:00:00 2001 From: liibang Date: Sun, 13 Aug 2023 12:28:02 +0800 Subject: [PATCH] =?UTF-8?q?QueryChain=E6=B7=BB=E5=8A=A0=E6=96=B0of?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E7=94=A8=E4=BA=8E=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E9=80=9A=E8=BF=87Entity=E5=88=9B=E5=BB=BAQueryChain=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/mybatisflex/core/query/QueryChain.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/QueryChain.java b/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/QueryChain.java index 5b14a0ee..bef5ab07 100644 --- a/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/QueryChain.java +++ b/mybatis-flex-core/src/main/java/com/mybatisflex/core/query/QueryChain.java @@ -17,6 +17,7 @@ package com.mybatisflex.core.query; import com.mybatisflex.core.BaseMapper; +import com.mybatisflex.core.mybatis.Mappers; import com.mybatisflex.core.paginate.Page; import com.mybatisflex.core.table.TableInfo; import com.mybatisflex.core.table.TableInfoFactory; @@ -38,6 +39,11 @@ public class QueryChain extends QueryWrapperAdapter> implements this.baseMapper = baseMapper; } + public static QueryChain of(Class entityClass) { + BaseMapper baseMapper = Mappers.ofEntityClass(entityClass); + return new QueryChain<>(baseMapper); + } + public static QueryChain of(BaseMapper baseMapper) { return new QueryChain<>(baseMapper); }