mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-06 16:48:24 +08:00
test: 测试逻辑删除默认字段配置。
This commit is contained in:
parent
105e5b3d97
commit
bb87fc81ce
@ -49,7 +49,7 @@ public class Account extends BaseEntity implements Serializable, AgeAware {
|
||||
@Column(typeHandler = Fastjson2TypeHandler.class)
|
||||
private Map<String, Object> options;
|
||||
|
||||
@Column(isLogicDelete = true)
|
||||
// @Column(isLogicDelete = true)
|
||||
private Boolean isDelete;
|
||||
|
||||
private List<Article> articles;
|
||||
|
||||
@ -15,6 +15,7 @@
|
||||
*/
|
||||
package com.mybatisflex.test;
|
||||
|
||||
import com.mybatisflex.core.FlexGlobalConfig;
|
||||
import com.mybatisflex.core.MybatisFlexBootstrap;
|
||||
import com.mybatisflex.core.audit.AuditManager;
|
||||
import com.mybatisflex.core.audit.ConsoleMessageCollector;
|
||||
@ -52,6 +53,9 @@ public class AccountTester {
|
||||
.addScript("data.sql")
|
||||
.build();
|
||||
|
||||
FlexGlobalConfig.getDefaultConfig()
|
||||
.setLogicDeleteColumn("is_delete");
|
||||
|
||||
MybatisFlexBootstrap bootstrap = MybatisFlexBootstrap.getInstance()
|
||||
.setDataSource(dataSource)
|
||||
.setLogImpl(StdOutImpl.class)
|
||||
@ -71,6 +75,11 @@ public class AccountTester {
|
||||
articleMapper = bootstrap.getMapper(ArticleMapper.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testLogicDelete() {
|
||||
accountMapper.selectAll().forEach(System.out::println);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExecutor() {
|
||||
DbChain.create()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user