mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 01:28:24 +08:00
test: test and close #I7VAG8
This commit is contained in:
parent
ba41596a7d
commit
5d83749edf
@ -54,6 +54,9 @@ public class Account extends BaseEntity implements Serializable, AgeAware {
|
||||
|
||||
private List<Article> 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 +
|
||||
'}';
|
||||
}
|
||||
|
||||
|
||||
@ -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<Account> accounts = accountMapper.selectListByQuery(queryWrapper);
|
||||
System.out.println(accounts);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
public void testSelectAsToDTO() {
|
||||
List<AccountDTO> accountDTOS = accountMapper.selectListByQueryAs(QueryWrapper.create(), AccountDTO.class);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user