io.github.dengchen2020.mybatis.injector.DcSqlInjector Maven / Gradle / Ivy
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;
}
}