Search in sources :

Example 1 with LogicDeleteByIdWithFill

use of com.baomidou.mybatisplus.extension.injector.methods.LogicDeleteByIdWithFill in project mybatis-plus-samples by baomidou.

the class MySqlInjector method getMethodList.

@Override
public List<AbstractMethod> getMethodList(Class<?> mapperClass, TableInfo tableInfo) {
    List<AbstractMethod> methodList = super.getMethodList(mapperClass, tableInfo);
    // 增加自定义方法
    methodList.add(new DeleteAll());
    methodList.add(new FindOne());
    /**
     * 以下 3 个为内置选装件
     * 头 2 个支持字段筛选函数
     */
    // 例: 不要指定了 update 填充的字段
    methodList.add(new InsertBatchSomeColumn(i -> i.getFieldFill() != FieldFill.UPDATE));
    methodList.add(new AlwaysUpdateSomeColumnById());
    methodList.add(new LogicDeleteByIdWithFill());
    return methodList;
}
Also used : FindOne(com.baomidou.samples.injector.methods.FindOne) List(java.util.List) TableInfo(com.baomidou.mybatisplus.core.metadata.TableInfo) FindOne(com.baomidou.samples.injector.methods.FindOne) InsertBatchSomeColumn(com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn) FieldFill(com.baomidou.mybatisplus.annotation.FieldFill) AbstractMethod(com.baomidou.mybatisplus.core.injector.AbstractMethod) AlwaysUpdateSomeColumnById(com.baomidou.mybatisplus.extension.injector.methods.AlwaysUpdateSomeColumnById) LogicDeleteByIdWithFill(com.baomidou.mybatisplus.extension.injector.methods.LogicDeleteByIdWithFill) DeleteAll(com.baomidou.samples.injector.methods.DeleteAll) DefaultSqlInjector(com.baomidou.mybatisplus.core.injector.DefaultSqlInjector) DeleteAll(com.baomidou.samples.injector.methods.DeleteAll) AbstractMethod(com.baomidou.mybatisplus.core.injector.AbstractMethod) InsertBatchSomeColumn(com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn) LogicDeleteByIdWithFill(com.baomidou.mybatisplus.extension.injector.methods.LogicDeleteByIdWithFill) AlwaysUpdateSomeColumnById(com.baomidou.mybatisplus.extension.injector.methods.AlwaysUpdateSomeColumnById)

Aggregations

FieldFill (com.baomidou.mybatisplus.annotation.FieldFill)1 AbstractMethod (com.baomidou.mybatisplus.core.injector.AbstractMethod)1 DefaultSqlInjector (com.baomidou.mybatisplus.core.injector.DefaultSqlInjector)1 TableInfo (com.baomidou.mybatisplus.core.metadata.TableInfo)1 AlwaysUpdateSomeColumnById (com.baomidou.mybatisplus.extension.injector.methods.AlwaysUpdateSomeColumnById)1 InsertBatchSomeColumn (com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn)1 LogicDeleteByIdWithFill (com.baomidou.mybatisplus.extension.injector.methods.LogicDeleteByIdWithFill)1 DeleteAll (com.baomidou.samples.injector.methods.DeleteAll)1 FindOne (com.baomidou.samples.injector.methods.FindOne)1 List (java.util.List)1