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

com.mybaits.jpa.sql.split.impl.SqlMethodSplitIn Maven / Gradle / Ivy

There is a newer version: 1.8
Show newest version
package com.mybaits.jpa.sql.split.impl;

import com.mybaits.jpa.jpaEnum.KeyWord;
import com.mybaits.jpa.sql.split.ISqlMethodSplit;

import java.util.ArrayList;
import java.util.List;

/**
 * 处理jpa 方法名关键字
 * Created by Administrator on 2019/12/20 0020.
 */
public class SqlMethodSplitIn implements ISqlMethodSplit {

    @Override
    public List sqlMethodSplit(List attributes) {
        List cruxList=new ArrayList<>();
        for (String attribute : attributes) {
            if(attribute.equals(KeyWord.NotIn.getValue())){
                cruxList.add(attribute);
                continue;
            }
            if(attribute.indexOf(KeyWord.In.getValue())==-1){
                cruxList.add(attribute);
                continue;
            }
            String[] cruxs=attribute.split(KeyWord.In.getValue());
            if(cruxs.length>0){
                for (String s : cruxs) {
                    cruxList.add(s);
                    cruxList.add(KeyWord.In.getValue());
                }
            }
        }
        return cruxList;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy