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

org.zodiac.mybatisplus.injector.MyBatisPlusSqlInjector Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version
package org.zodiac.mybatisplus.injector;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.core.injector.AbstractMethod;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.extension.injector.methods.InsertBatchSomeColumn;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

import org.zodiac.mybatisplus.injector.methods.InsertBatch;
import org.zodiac.mybatisplus.injector.methods.InsertIgnore;
import org.zodiac.mybatisplus.injector.methods.Replace;
import org.zodiac.mybatisplus.injector.methods.SaveOrUpdate;
import org.zodiac.mybatisplus.injector.methods.UpdateBatchById;

public class MyBatisPlusSqlInjector extends DefaultSqlInjector {

    public MyBatisPlusSqlInjector() {
        super();
    }

    @Override
    public List getMethodList(Class mapperClass) {
        List methodArrayList = new ArrayList<>();
        methodArrayList.addAll(super.getMethodList(mapperClass));
        methodArrayList.addAll(
            Stream.of(new InsertBatch(), new InsertIgnore(), new Replace(), new SaveOrUpdate(), new UpdateBatchById(),
                new InsertBatchSomeColumn(i -> i.getFieldFill() != FieldFill.UPDATE)).collect(Collectors.toList()));
        return methodArrayList;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy