mirror of https://github.com/jeecgboot/jeecg-boot
使用minidao适配jsqlparser
parent
748331d649
commit
f78eabfc66
|
@ -71,18 +71,7 @@ public class DictTableWhiteListHandlerImpl implements IDictTableWhiteListHandler
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isPassBySql(String sql) {
|
public boolean isPassBySql(String sql) {
|
||||||
Select select = null;
|
String tableName = MiniDaoUtil.parseTable(sql);
|
||||||
|
|
||||||
try {
|
|
||||||
select = (Select) CCJSqlParserUtil.parse(sql, (parser) -> {
|
|
||||||
parser.withSquareBracketQuotation(true);
|
|
||||||
});
|
|
||||||
} catch (JSQLParserException var10) {
|
|
||||||
JSQLParserException jsqlParserException = var10;
|
|
||||||
jsqlParserException.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
String tableName = ((Table)((PlainSelect)select.getSelectBody()).getFromItem()).getName();
|
|
||||||
|
|
||||||
List<Map<String, Object>> parsedMap = null;
|
List<Map<String, Object>> parsedMap = null;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -1,56 +1,56 @@
|
||||||
////
|
|
||||||
//// Source code recreated from a .class file by IntelliJ IDEA
|
|
||||||
//// (powered by Fernflower decompiler)
|
|
||||||
////
|
|
||||||
//
|
//
|
||||||
//package org.springframework.boot.autoconfigure.mongo;
|
// Source code recreated from a .class file by IntelliJ IDEA
|
||||||
|
// (powered by Fernflower decompiler)
|
||||||
//
|
//
|
||||||
//import com.mongodb.MongoClientSettings;
|
|
||||||
//import com.mongodb.client.MongoClient;
|
package org.springframework.boot.autoconfigure.mongo;
|
||||||
//import org.springframework.beans.factory.ObjectProvider;
|
|
||||||
//import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import com.mongodb.MongoClientSettings;
|
||||||
//import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
import com.mongodb.client.MongoClient;
|
||||||
//import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
import org.springframework.beans.factory.ObjectProvider;
|
||||||
//import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
//import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||||
//import org.springframework.context.annotation.Bean;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||||
//import org.springframework.context.annotation.Configuration;
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
//import org.springframework.context.annotation.Primary;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
//import org.springframework.core.env.Environment;
|
import org.springframework.context.annotation.Bean;
|
||||||
//
|
import org.springframework.context.annotation.Configuration;
|
||||||
//import java.util.List;
|
import org.springframework.context.annotation.Primary;
|
||||||
//import java.util.stream.Collectors;
|
import org.springframework.core.env.Environment;
|
||||||
//
|
|
||||||
//@Primary
|
import java.util.List;
|
||||||
//@AutoConfiguration
|
import java.util.stream.Collectors;
|
||||||
//@ConditionalOnClass({MongoClient.class})
|
|
||||||
//@ConditionalOnProperty(name = "spring.data.mongodb.uri", havingValue = "", matchIfMissing = false)
|
@Primary
|
||||||
//@EnableConfigurationProperties({MongoProperties.class})
|
@AutoConfiguration
|
||||||
//@ConditionalOnMissingBean(
|
@ConditionalOnClass({MongoClient.class})
|
||||||
// type = {"org.springframework.data.mongodb.MongoDatabaseFactory"}
|
@ConditionalOnProperty(name = "spring.data.mongodb.uri", havingValue = "", matchIfMissing = false)
|
||||||
//)
|
@EnableConfigurationProperties({MongoProperties.class})
|
||||||
//public class MongoAutoConfiguration {
|
@ConditionalOnMissingBean(
|
||||||
// public MongoAutoConfiguration() {
|
type = {"org.springframework.data.mongodb.MongoDatabaseFactory"}
|
||||||
// }
|
)
|
||||||
//
|
public class MongoAutoConfiguration {
|
||||||
// @Bean
|
public MongoAutoConfiguration() {
|
||||||
// @ConditionalOnMissingBean({MongoClient.class})
|
}
|
||||||
// public MongoClient mongo(ObjectProvider<MongoClientSettingsBuilderCustomizer> builderCustomizers, MongoClientSettings settings) {
|
|
||||||
// return (MongoClient)(new MongoClientFactory((List)builderCustomizers.orderedStream().collect(Collectors.toList()))).createMongoClient(settings);
|
@Bean
|
||||||
// }
|
@ConditionalOnMissingBean({MongoClient.class})
|
||||||
//
|
public MongoClient mongo(ObjectProvider<MongoClientSettingsBuilderCustomizer> builderCustomizers, MongoClientSettings settings) {
|
||||||
// @Configuration(
|
return (MongoClient)(new MongoClientFactory((List)builderCustomizers.orderedStream().collect(Collectors.toList()))).createMongoClient(settings);
|
||||||
// proxyBeanMethods = false
|
}
|
||||||
// )
|
|
||||||
// @ConditionalOnMissingBean({MongoClientSettings.class})
|
@Configuration(
|
||||||
// static class MongoClientSettingsConfiguration {
|
proxyBeanMethods = false
|
||||||
// MongoClientSettingsConfiguration() {
|
)
|
||||||
// }
|
@ConditionalOnMissingBean({MongoClientSettings.class})
|
||||||
//
|
static class MongoClientSettingsConfiguration {
|
||||||
// @Bean
|
MongoClientSettingsConfiguration() {
|
||||||
// MongoClientSettings mongoClientSettings() {
|
}
|
||||||
// return MongoClientSettings.builder().build();
|
|
||||||
// }
|
@Bean
|
||||||
//
|
MongoClientSettings mongoClientSettings() {
|
||||||
// }
|
return MongoClientSettings.builder().build();
|
||||||
//}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue