com.baomidou.mybatisplus.mapper.ISqlInjector Java Examples

The following examples show how to use com.baomidou.mybatisplus.mapper.ISqlInjector. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GlobalConfig.java    From mybatis-plus-sharding-jdbc-spring-boot-starter with Apache License 2.0 5 votes vote down vote up
public GlobalConfiguration convertGlobalConfiguration() throws ClassNotFoundException, IllegalAccessException, InstantiationException {
    GlobalConfiguration globalConfiguration = new GlobalConfiguration();
    if (StringUtils.isNotEmpty(this.getIdentifierQuote())) {
        globalConfiguration.setIdentifierQuote(this.getIdentifierQuote());
    }
    if (StringUtils.isNotEmpty(this.getLogicDeleteValue())) {
        globalConfiguration.setLogicDeleteValue(this.getLogicDeleteValue());
    }
    if (StringUtils.isNotEmpty(this.getLogicNotDeleteValue())) {
        globalConfiguration.setLogicNotDeleteValue(this.getLogicNotDeleteValue());
    }
    if (StringUtils.isNotEmpty(this.getSqlInjector())) {
        globalConfiguration.setSqlInjector((ISqlInjector) Class.forName(this.getSqlInjector()).newInstance());
    }
    if (StringUtils.isNotEmpty(this.getMetaObjectHandler())) {
        globalConfiguration.setMetaObjectHandler((MetaObjectHandler) Class.forName(this.getMetaObjectHandler()).newInstance());
    }
    if (StringUtils.isNotEmpty(this.getKeyGenerator())) {
        globalConfiguration.setKeyGenerator((IKeyGenerator) Class.forName(this.getKeyGenerator()).newInstance());
    }
    if (StringUtils.checkValNotNull(this.getIdType())) {
        globalConfiguration.setIdType(this.getIdType());
    }
    if (null != this.getDbColumnUnderline()) {
        globalConfiguration.setDbColumnUnderline(this.getDbColumnUnderline());
    }
    if (StringUtils.checkValNotNull(this.getFieldStrategy())) {
        globalConfiguration.setFieldStrategy(this.getFieldStrategy());
    }
    if (StringUtils.checkValNotNull(this.getRefreshMapper())) {
        globalConfiguration.setRefresh(this.getRefreshMapper());
    }
    if (StringUtils.checkValNotNull(this.getCapitalMode())) {
        globalConfiguration.setCapitalMode(this.getCapitalMode());
    }
    if (null != this.getSqlParserCache()) {
        globalConfiguration.setSqlParserCache(this.getSqlParserCache());
    }
    return globalConfiguration;
}
 
Example #2
Source File: MybatisPlusConfig.java    From RCT with Apache License 2.0 4 votes vote down vote up
/**
 * 注入sql注入器
 */
@Bean
public ISqlInjector sqlInjector() {
	return new LogicSqlInjector();
}
 
Example #3
Source File: MybatisPlusConfig.java    From easyweb-shiro with MIT License 4 votes vote down vote up
/**
 * 注入sql注入器
 */
@Bean
public ISqlInjector sqlInjector() {
    return new LogicSqlInjector();
}