mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 01:28:24 +08:00
!279 QueryChain添加新of方法,用于支持通过Entity创建QueryChain对象
Merge pull request !279 from liibang/main
This commit is contained in:
commit
bace7dcfb2
@ -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<T> extends QueryWrapperAdapter<QueryChain<T>> implements
|
||||
this.baseMapper = baseMapper;
|
||||
}
|
||||
|
||||
public static <T> QueryChain<T> of(Class<T> entityClass) {
|
||||
BaseMapper<T> baseMapper = Mappers.ofEntityClass(entityClass);
|
||||
return new QueryChain<>(baseMapper);
|
||||
}
|
||||
|
||||
public static <E> QueryChain<E> of(BaseMapper<E> baseMapper) {
|
||||
return new QueryChain<>(baseMapper);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user