All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.dengchen2020.mybatis.injector.DcSqlInjector Maven / Gradle / Ivy

There is a newer version: 0.0.28
Show newest version
package io.github.dengchen2020.mybatis.injector;

import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.metadata.TableInfo;
import io.github.dengchen2020.mybatis.methods.SelectByIdForUpdateMethod;
import io.github.dengchen2020.mybatis.methods.SoftDeleteMethod;
import org.apache.ibatis.session.Configuration;

import java.util.List;

/**
 * 通用sql注入器
 * @author dengchen
 * @since 2024/6/22
 */
public class DcSqlInjector extends DefaultSqlInjector {

    @Override
    public List getMethodList(Configuration configuration, Class mapperClass, TableInfo tableInfo) {
        List methodList = super.getMethodList(configuration, mapperClass, tableInfo);
        methodList.add(new SoftDeleteMethod("softDelete"));
        methodList.add(new SelectByIdForUpdateMethod("selectByIdForUpdate"));
        return methodList;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy