mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-07 00:58: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)
|
@Column(typeHandler = Fastjson2TypeHandler.class)
|
||||||
private Map<String, Object> options;
|
private Map<String, Object> options;
|
||||||
|
|
||||||
@Column(isLogicDelete = true)
|
// @Column(isLogicDelete = true)
|
||||||
private Boolean isDelete;
|
private Boolean isDelete;
|
||||||
|
|
||||||
private List<Article> articles;
|
private List<Article> articles;
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.mybatisflex.test;
|
package com.mybatisflex.test;
|
||||||
|
|
||||||
|
import com.mybatisflex.core.FlexGlobalConfig;
|
||||||
import com.mybatisflex.core.MybatisFlexBootstrap;
|
import com.mybatisflex.core.MybatisFlexBootstrap;
|
||||||
import com.mybatisflex.core.audit.AuditManager;
|
import com.mybatisflex.core.audit.AuditManager;
|
||||||
import com.mybatisflex.core.audit.ConsoleMessageCollector;
|
import com.mybatisflex.core.audit.ConsoleMessageCollector;
|
||||||
@ -52,6 +53,9 @@ public class AccountTester {
|
|||||||
.addScript("data.sql")
|
.addScript("data.sql")
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
FlexGlobalConfig.getDefaultConfig()
|
||||||
|
.setLogicDeleteColumn("is_delete");
|
||||||
|
|
||||||
MybatisFlexBootstrap bootstrap = MybatisFlexBootstrap.getInstance()
|
MybatisFlexBootstrap bootstrap = MybatisFlexBootstrap.getInstance()
|
||||||
.setDataSource(dataSource)
|
.setDataSource(dataSource)
|
||||||
.setLogImpl(StdOutImpl.class)
|
.setLogImpl(StdOutImpl.class)
|
||||||
@ -71,6 +75,11 @@ public class AccountTester {
|
|||||||
articleMapper = bootstrap.getMapper(ArticleMapper.class);
|
articleMapper = bootstrap.getMapper(ArticleMapper.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testLogicDelete() {
|
||||||
|
accountMapper.selectAll().forEach(System.out::println);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testExecutor() {
|
public void testExecutor() {
|
||||||
DbChain.create()
|
DbChain.create()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user