mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 17:18:24 +08:00
QueryChain添加新of方法,用于支持通过Entity创建QueryChain对象
This commit is contained in:
parent
9c5a00300b
commit
970ac21463
@ -17,6 +17,7 @@
|
|||||||
package com.mybatisflex.core.query;
|
package com.mybatisflex.core.query;
|
||||||
|
|
||||||
import com.mybatisflex.core.BaseMapper;
|
import com.mybatisflex.core.BaseMapper;
|
||||||
|
import com.mybatisflex.core.mybatis.Mappers;
|
||||||
import com.mybatisflex.core.paginate.Page;
|
import com.mybatisflex.core.paginate.Page;
|
||||||
import com.mybatisflex.core.table.TableInfo;
|
import com.mybatisflex.core.table.TableInfo;
|
||||||
import com.mybatisflex.core.table.TableInfoFactory;
|
import com.mybatisflex.core.table.TableInfoFactory;
|
||||||
@ -38,6 +39,11 @@ public class QueryChain<T> extends QueryWrapperAdapter<QueryChain<T>> implements
|
|||||||
this.baseMapper = baseMapper;
|
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) {
|
public static <E> QueryChain<E> of(BaseMapper<E> baseMapper) {
|
||||||
return new QueryChain<>(baseMapper);
|
return new QueryChain<>(baseMapper);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user