mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 17:18:24 +08:00
fixed:不支持自己扩展 mapper 的问题;close #I6ZTS3
This commit is contained in:
parent
2a47e0b526
commit
e5c208d888
@ -102,6 +102,8 @@ public class TableInfoFactory {
|
||||
Type type = genericInterfaces[0];
|
||||
if (type instanceof ParameterizedType) {
|
||||
return (Class<?>) ((ParameterizedType) type).getActualTypeArguments()[0];
|
||||
} else if (type instanceof Class) {
|
||||
return getEntityClass((Class<?>) type);
|
||||
}
|
||||
}
|
||||
return getEntityClass(mapperClass.getSuperclass());
|
||||
|
||||
@ -27,7 +27,6 @@ import javax.sql.DataSource;
|
||||
import java.util.List;
|
||||
|
||||
import static com.mybatisflex.test.table.Tables.ACCOUNT;
|
||||
import static com.mybatisflex.test.table.Tables.ARTICLE;
|
||||
|
||||
public class EntityTestStarter {
|
||||
|
||||
@ -41,6 +40,7 @@ public class EntityTestStarter {
|
||||
MybatisFlexBootstrap bootstrap = MybatisFlexBootstrap.getInstance()
|
||||
.setDataSource(dataSource)
|
||||
.addMapper(AccountMapper.class)
|
||||
.addMapper(MyAccountMapper.class)
|
||||
.start();
|
||||
|
||||
//开启审计功能
|
||||
@ -52,6 +52,9 @@ public class EntityTestStarter {
|
||||
|
||||
|
||||
AccountMapper accountMapper = bootstrap.getMapper(AccountMapper.class);
|
||||
MyAccountMapper myAccountMapper = bootstrap.getMapper(MyAccountMapper.class);
|
||||
|
||||
List<Account> accounts1 = myAccountMapper.selectAll();
|
||||
|
||||
// QueryWrapper wrapper = QueryWrapper.create().select().from(ACCOUNT)
|
||||
// .and(ACCOUNT.ID.ge(100).and(ACCOUNT.ID.ge(200)))
|
||||
@ -62,8 +65,8 @@ public class EntityTestStarter {
|
||||
|
||||
|
||||
QueryWrapper wrapper = QueryWrapper.create().select().from(ACCOUNT)
|
||||
.leftJoin(ARTICLE).on(ARTICLE.ACCOUNT_ID.eq(ACCOUNT.ID).and(ACCOUNT.ID.ge(100)))
|
||||
.and(ACCOUNT.ID.ge(100));
|
||||
// .leftJoin(ARTICLE).on(ARTICLE.ACCOUNT_ID.eq(ACCOUNT.ID).and(ACCOUNT.ID.ge(100)))
|
||||
.and(ACCOUNT.ID.ge(100).when(false));
|
||||
|
||||
List<Account> accounts = accountMapper.selectListByQuery(wrapper);
|
||||
System.out.println(accounts);
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
package com.mybatisflex.test;
|
||||
|
||||
public interface MyAccountMapper extends AccountMapper{
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user