test: 测试 ignore 属性解析。

This commit is contained in:
Suomm 2023-08-24 20:14:54 +08:00
parent 5829c8fb5b
commit 07362c87ab
3 changed files with 33 additions and 16 deletions

View File

@ -45,6 +45,9 @@ public class Account extends BaseEntity<String, Long, String> {
@Column(isLogicDelete = true)
private Boolean isDelete;
@Column(ignore = true)
private String anotherColumn;
// private Gender gender;
//
// public Gender getGender() {
@ -95,6 +98,14 @@ public class Account extends BaseEntity<String, Long, String> {
isDelete = delete;
}
public String getAnotherColumn() {
return anotherColumn;
}
public void setAnotherColumn(String anotherColumn) {
this.anotherColumn = anotherColumn;
}
@Override
public String toString() {
return "Account{" +
@ -103,6 +114,7 @@ public class Account extends BaseEntity<String, Long, String> {
", age=" + age +
", birthday=" + birthday +
", isDelete=" + isDelete +
", anotherColumn=" + anotherColumn +
// ", roles=" + roles +
'}';
}

View File

@ -1,13 +1,13 @@
# DataSource Config
#spring:
spring:
# # h2:
# # console:
# # enabled: true
# datasource:
## driver-class-name: com.mysql.cj.jdbc.Driver
# url: jdbc:mysql://localhost:3306/flex_test
# username: root
# password: 123456
datasource:
# driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/flex_test
username: root
password: 12345678
# driver-class-name:
# datasource:
# driver-class-name: org.h2.Driver
@ -36,13 +36,13 @@
# url: jdbc:mysql://localhost:3306/flex_test
# username: root
# password: 12345678
mybatis-flex:
datasource:
ds1:
url: jdbc:mysql://127.0.0.1:3306/flex_test
username: root
password: 123456
ds2:
url: jdbc:mysql://127.0.0.1:3306/flex_test
username: root
password: 123456
#mybatis-flex:
# datasource:
# ds1:
# url: jdbc:mysql://127.0.0.1:3306/flex_test
# username: root
# password: 123456
# ds2:
# url: jdbc:mysql://127.0.0.1:3306/flex_test
# username: root
# password: 123456

View File

@ -178,4 +178,9 @@ class AccountMapperTest {
System.out.println(account);
}
@Test
void testIgnoreColumn() {
accountMapper.selectListByQuery(QueryWrapper.create());
}
}