diff --git a/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/Account.java b/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/Account.java index bc6e6f58..f19009a0 100644 --- a/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/Account.java +++ b/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/Account.java @@ -54,6 +54,9 @@ public class Account extends BaseEntity implements Serializable, AgeAware { private List
articles; + @Column(ignore = true) + private String title; + public Long getId() { return id; @@ -120,6 +123,14 @@ public class Account extends BaseEntity implements Serializable, AgeAware { this.articles = articles; } + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + @Override public String toString() { return "Account{" + @@ -130,6 +141,7 @@ public class Account extends BaseEntity implements Serializable, AgeAware { ", options=" + options + ", isDelete=" + isDelete + ", articles=" + articles + + ", title=" + title + '}'; } diff --git a/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/AccountTester.java b/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/AccountTester.java index 6a05e47e..0e72b0e7 100644 --- a/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/AccountTester.java +++ b/mybatis-flex-test/mybatis-flex-native-test/src/main/java/com/mybatisflex/test/AccountTester.java @@ -141,6 +141,24 @@ public class AccountTester { } + /** + * issues https://gitee.com/mybatis-flex/mybatis-flex/issues/I7VAG8 + */ + @Test + public void testLeftJoinSelectWithIgnoreColumn() { + QueryWrapper queryWrapper = QueryWrapper.create(); + queryWrapper + .select(ACCOUNT.ID,ACCOUNT.AGE,ARTICLE.TITLE) + .from(ACCOUNT) + .leftJoin(ARTICLE).on(ACCOUNT.ID.eq(ARTICLE.ACCOUNT_ID)) + .where(ACCOUNT.ID.ge(1)); + List accounts = accountMapper.selectListByQuery(queryWrapper); + System.out.println(accounts); + } + + + + @Test public void testSelectAsToDTO() { List accountDTOS = accountMapper.selectListByQueryAs(QueryWrapper.create(), AccountDTO.class);