|
@ -5,6 +5,9 @@ import com.yihu.quota.dao.source.DataSourcesTableFieldDao;
|
|
|
import com.yihu.quota.model.source.DataSourcesTableField;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* Created by wxw on 2018/9/10.
|
|
|
*
|
|
@ -12,4 +15,22 @@ import org.springframework.stereotype.Service;
|
|
|
*/
|
|
|
@Service
|
|
|
public class DataSourcesTableFieldService extends BaseJpaService<DataSourcesTableField, DataSourcesTableFieldDao> {
|
|
|
/**
|
|
|
* 定义基础数据类型
|
|
|
*/
|
|
|
private final static String[] TYPE = {"tiny int", "int", "integer", "float", "long", "double", "decimal", "char",
|
|
|
"varchar", "text", "string", "date", "datetime", "timestamp", "time", "binary", "boolean", "nested", "keyword"};
|
|
|
|
|
|
/**
|
|
|
* 是否是允许的数据类型
|
|
|
* @param fieldType
|
|
|
* @return
|
|
|
*/
|
|
|
public boolean isAllowType(String fieldType) {
|
|
|
List<String> list = Arrays.asList(TYPE);
|
|
|
if (list.contains(fieldType.toLowerCase())) {
|
|
|
return true;
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
}
|