org.apache.ibatis.scripting.LanguageDriver Java Examples
The following examples show how to use
org.apache.ibatis.scripting.LanguageDriver.
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: MapperAnnotationBuilder.java From mybatis with Apache License 2.0 | 6 votes |
private SqlSource getSqlSourceFromAnnotations(Method method, Class<?> parameterType, LanguageDriver languageDriver) { try { Class<? extends Annotation> sqlAnnotationType = getSqlAnnotationType(method); Class<? extends Annotation> sqlProviderAnnotationType = getSqlProviderAnnotationType(method); if (sqlAnnotationType != null) { if (sqlProviderAnnotationType != null) { throw new BindingException("You cannot supply both a static SQL and SqlProvider to method named " + method.getName()); } Annotation sqlAnnotation = method.getAnnotation(sqlAnnotationType); final String[] strings = (String[]) sqlAnnotation.getClass().getMethod("value").invoke(sqlAnnotation); return buildSqlSourceFromStrings(strings, parameterType, languageDriver); } else if (sqlProviderAnnotationType != null) { Annotation sqlProviderAnnotation = method.getAnnotation(sqlProviderAnnotationType); return new ProviderSqlSource(assistant.getConfiguration(), sqlProviderAnnotation); } return null; } catch (Exception e) { throw new BuilderException("Could not find value method on SQL annotation. Cause: " + e, e); } }
Example #2
Source File: MapperAnnotationBuilder.java From mybaties with Apache License 2.0 | 6 votes |
private SqlSource getSqlSourceFromAnnotations(Method method, Class<?> parameterType, LanguageDriver languageDriver) { try { Class<? extends Annotation> sqlAnnotationType = getSqlAnnotationType(method); Class<? extends Annotation> sqlProviderAnnotationType = getSqlProviderAnnotationType(method); if (sqlAnnotationType != null) { if (sqlProviderAnnotationType != null) { throw new BindingException("You cannot supply both a static SQL and SqlProvider to method named " + method.getName()); } Annotation sqlAnnotation = method.getAnnotation(sqlAnnotationType); final String[] strings = (String[]) sqlAnnotation.getClass().getMethod("value").invoke(sqlAnnotation); return buildSqlSourceFromStrings(strings, parameterType, languageDriver); } else if (sqlProviderAnnotationType != null) { Annotation sqlProviderAnnotation = method.getAnnotation(sqlProviderAnnotationType); return new ProviderSqlSource(assistant.getConfiguration(), sqlProviderAnnotation); } return null; } catch (Exception e) { throw new BuilderException("Could not find value method on SQL annotation. Cause: " + e, e); } }
Example #3
Source File: DeleteBuilder.java From azeroth with Apache License 2.0 | 6 votes |
/** * @param configuration * @param entity */ public static void build(Configuration configuration, LanguageDriver languageDriver, EntityInfo entity) { String msId = entity.getMapperClass().getName() + "." + GeneralSqlGenerator.methodDefines.deleteName(); // 从参数对象里提取注解信息 EntityMapper entityMapper = EntityHelper.getEntityMapper(entity.getEntityClass()); // 生成sql String sql = buildDeleteSql(entityMapper); SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, entity.getEntityClass()); MappedStatement.Builder statementBuilder = new MappedStatement.Builder(configuration, msId, sqlSource, SqlCommandType.DELETE); MappedStatement statement = statementBuilder.build(); configuration.addMappedStatement(statement); }
Example #4
Source File: UpdateBuilder.java From azeroth with Apache License 2.0 | 6 votes |
/** * @param configuration * @param entity */ public static void build(Configuration configuration, LanguageDriver languageDriver, EntityInfo entity) { String[] names = GeneralSqlGenerator.methodDefines.updateName().split(","); for (String name : names) { String msId = entity.getMapperClass().getName() + "." + name; EntityMapper entityMapper = EntityHelper.getEntityMapper(entity.getEntityClass()); String sql = buildUpdateSql(entityMapper, name.endsWith("Selective")); SqlSource sqlSource = languageDriver.createSqlSource(configuration, sql, entity.getEntityClass()); MappedStatement.Builder statementBuilder = new MappedStatement.Builder(configuration, msId, sqlSource, SqlCommandType.UPDATE); MappedStatement statement = statementBuilder.build(); configuration.addMappedStatement(statement); } }
Example #5
Source File: UpdateStatementFactory.java From mybatis-jpa with Apache License 2.0 | 6 votes |
@Override public MappedStatement parseStatement(Configuration configuration, Method method, Class<?> targetClass) { String resourceName = targetClass.toString(); if (!configuration.isResourceLoaded(resourceName)) { configuration.addLoadedResource(resourceName); } String targetClassName = targetClass.getName(); Class<?> type = super.recognizeEntityType(method, targetClass); LanguageDriver languageDriver = Constant.XML_LANGUAGE_DRIVER; SqlSource sqlSource = languageDriver .createSqlSource(configuration, "<script> " + parseSQL(method, type) + "</script>", Object.class); String statementId = targetClassName + "." + method.getName(); MappedStatement.Builder builder = new MappedStatement.Builder(configuration, statementId, sqlSource, SqlCommandType.UPDATE); builder.resource(super.recognizeResource(targetClassName)).lang(languageDriver) .statementType(StatementType.PREPARED); return builder.build(); }
Example #6
Source File: XMLStatementBuilder.java From mybaties with Apache License 2.0 | 5 votes |
private LanguageDriver getLanguageDriver(String lang) { Class<?> langClass = null; if (lang != null) { langClass = resolveClass(lang); } //调用builderAssistant return builderAssistant.getLanguageDriver(langClass); }
Example #7
Source File: XMLStatementBuilder.java From mybatis with Apache License 2.0 | 5 votes |
private LanguageDriver getLanguageDriver(String lang) { Class<?> langClass = null; if (lang != null) { langClass = resolveClass(lang); } //调用builderAssistant return builderAssistant.getLanguageDriver(langClass); }
Example #8
Source File: AuthorityDatabaseAutoConfiguration.java From zuihou-admin-boot with Apache License 2.0 | 5 votes |
public AuthorityDatabaseAutoConfiguration(MybatisPlusProperties properties, DatabaseProperties databaseProperties, ObjectProvider<Interceptor[]> interceptorsProvider, ObjectProvider<TypeHandler[]> typeHandlersProvider, ObjectProvider<LanguageDriver[]> languageDriversProvider, ResourceLoader resourceLoader, ObjectProvider<DatabaseIdProvider> databaseIdProvider, ObjectProvider<List<ConfigurationCustomizer>> configurationCustomizersProvider, ObjectProvider<List<MybatisPlusPropertiesCustomizer>> mybatisPlusPropertiesCustomizerProvider, ApplicationContext applicationContext) { super(properties, databaseProperties, interceptorsProvider, typeHandlersProvider, languageDriversProvider, resourceLoader, databaseIdProvider, configurationCustomizersProvider, mybatisPlusPropertiesCustomizerProvider, applicationContext); log.debug("检测到 zuihou.database.multiTenantType!=DATASOURCE,加载了 AuthorityDatabaseAutoConfiguration"); }
Example #9
Source File: MapperAnnotationBuilder.java From mybaties with Apache License 2.0 | 5 votes |
private KeyGenerator handleSelectKeyAnnotation(SelectKey selectKeyAnnotation, String baseStatementId, Class<?> parameterTypeClass, LanguageDriver languageDriver) { String id = baseStatementId + SelectKeyGenerator.SELECT_KEY_SUFFIX; Class<?> resultTypeClass = selectKeyAnnotation.resultType(); StatementType statementType = selectKeyAnnotation.statementType(); String keyProperty = selectKeyAnnotation.keyProperty(); String keyColumn = selectKeyAnnotation.keyColumn(); boolean executeBefore = selectKeyAnnotation.before(); // defaults boolean useCache = false; KeyGenerator keyGenerator = new NoKeyGenerator(); Integer fetchSize = null; Integer timeout = null; boolean flushCache = false; String parameterMap = null; String resultMap = null; ResultSetType resultSetTypeEnum = null; SqlSource sqlSource = buildSqlSourceFromStrings(selectKeyAnnotation.statement(), parameterTypeClass, languageDriver); SqlCommandType sqlCommandType = SqlCommandType.SELECT; assistant.addMappedStatement(id, sqlSource, statementType, sqlCommandType, fetchSize, timeout, parameterMap, parameterTypeClass, resultMap, resultTypeClass, resultSetTypeEnum, flushCache, useCache, false, keyGenerator, keyProperty, keyColumn, null, languageDriver, null); id = assistant.applyCurrentNamespace(id, false); MappedStatement keyStatement = configuration.getMappedStatement(id, false); SelectKeyGenerator answer = new SelectKeyGenerator(keyStatement, executeBefore); configuration.addKeyGenerator(id, answer); return answer; }
Example #10
Source File: MapperBuilderAssistant.java From mybaties with Apache License 2.0 | 5 votes |
public LanguageDriver getLanguageDriver(Class<?> langClass) { if (langClass != null) { //注册语言驱动 configuration.getLanguageRegistry().register(langClass); } else { //如果为null,则取得默认驱动(mybatis3.2以前大家一直用的方法) langClass = configuration.getLanguageRegistry().getDefaultDriverClass(); } //再去调configuration return configuration.getLanguageRegistry().getDriver(langClass); }
Example #11
Source File: MapperBuilderAssistant.java From mybaties with Apache License 2.0 | 5 votes |
/** Backward compatibility signature */ //向后兼容方法 public MappedStatement addMappedStatement( String id, SqlSource sqlSource, StatementType statementType, SqlCommandType sqlCommandType, Integer fetchSize, Integer timeout, String parameterMap, Class<?> parameterType, String resultMap, Class<?> resultType, ResultSetType resultSetType, boolean flushCache, boolean useCache, boolean resultOrdered, KeyGenerator keyGenerator, String keyProperty, String keyColumn, String databaseId, LanguageDriver lang) { return addMappedStatement( id, sqlSource, statementType, sqlCommandType, fetchSize, timeout, parameterMap, parameterType, resultMap, resultType, resultSetType, flushCache, useCache, resultOrdered, keyGenerator, keyProperty, keyColumn, databaseId, lang, null); }
Example #12
Source File: XMLStatementBuilder.java From mybaties with Apache License 2.0 | 5 votes |
private void processSelectKeyNodes(String id, Class<?> parameterTypeClass, LanguageDriver langDriver) { List<XNode> selectKeyNodes = context.evalNodes("selectKey"); if (configuration.getDatabaseId() != null) { parseSelectKeyNodes(id, selectKeyNodes, parameterTypeClass, langDriver, configuration.getDatabaseId()); } parseSelectKeyNodes(id, selectKeyNodes, parameterTypeClass, langDriver, null); removeSelectKeyNodes(selectKeyNodes); }
Example #13
Source File: XMLStatementBuilder.java From mybaties with Apache License 2.0 | 5 votes |
private void parseSelectKeyNodes(String parentId, List<XNode> list, Class<?> parameterTypeClass, LanguageDriver langDriver, String skRequiredDatabaseId) { for (XNode nodeToHandle : list) { String id = parentId + SelectKeyGenerator.SELECT_KEY_SUFFIX; String databaseId = nodeToHandle.getStringAttribute("databaseId"); if (databaseIdMatchesCurrent(id, databaseId, skRequiredDatabaseId)) { parseSelectKeyNode(id, nodeToHandle, parameterTypeClass, langDriver, databaseId); } } }
Example #14
Source File: XMLStatementBuilder.java From mybaties with Apache License 2.0 | 5 votes |
private void parseSelectKeyNode(String id, XNode nodeToHandle, Class<?> parameterTypeClass, LanguageDriver langDriver, String databaseId) { String resultType = nodeToHandle.getStringAttribute("resultType"); Class<?> resultTypeClass = resolveClass(resultType); StatementType statementType = StatementType.valueOf(nodeToHandle.getStringAttribute("statementType", StatementType.PREPARED.toString())); String keyProperty = nodeToHandle.getStringAttribute("keyProperty"); String keyColumn = nodeToHandle.getStringAttribute("keyColumn"); boolean executeBefore = "BEFORE".equals(nodeToHandle.getStringAttribute("order", "AFTER")); //defaults boolean useCache = false; boolean resultOrdered = false; KeyGenerator keyGenerator = new NoKeyGenerator(); Integer fetchSize = null; Integer timeout = null; boolean flushCache = false; String parameterMap = null; String resultMap = null; ResultSetType resultSetTypeEnum = null; SqlSource sqlSource = langDriver.createSqlSource(configuration, nodeToHandle, parameterTypeClass); SqlCommandType sqlCommandType = SqlCommandType.SELECT; builderAssistant.addMappedStatement(id, sqlSource, statementType, sqlCommandType, fetchSize, timeout, parameterMap, parameterTypeClass, resultMap, resultTypeClass, resultSetTypeEnum, flushCache, useCache, resultOrdered, keyGenerator, keyProperty, keyColumn, databaseId, langDriver, null); id = builderAssistant.applyCurrentNamespace(id, false); MappedStatement keyStatement = configuration.getMappedStatement(id, false); configuration.addKeyGenerator(id, new SelectKeyGenerator(keyStatement, executeBefore)); }
Example #15
Source File: MapperBuilderAssistant.java From mybatis with Apache License 2.0 | 5 votes |
/** Backward compatibility signature */ //向后兼容方法 public MappedStatement addMappedStatement( String id, SqlSource sqlSource, StatementType statementType, SqlCommandType sqlCommandType, Integer fetchSize, Integer timeout, String parameterMap, Class<?> parameterType, String resultMap, Class<?> resultType, ResultSetType resultSetType, boolean flushCache, boolean useCache, boolean resultOrdered, KeyGenerator keyGenerator, String keyProperty, String keyColumn, String databaseId, LanguageDriver lang) { return addMappedStatement( id, sqlSource, statementType, sqlCommandType, fetchSize, timeout, parameterMap, parameterType, resultMap, resultType, resultSetType, flushCache, useCache, resultOrdered, keyGenerator, keyProperty, keyColumn, databaseId, lang, null); }
Example #16
Source File: MapperAnnotationBuilder.java From mybatis with Apache License 2.0 | 5 votes |
private LanguageDriver getLanguageDriver(Method method) { Lang lang = method.getAnnotation(Lang.class); Class<?> langClass = null; if (lang != null) { langClass = lang.value(); } return assistant.getLanguageDriver(langClass); }
Example #17
Source File: XMLStatementBuilder.java From mybatis with Apache License 2.0 | 5 votes |
private void parseSelectKeyNode(String id, XNode nodeToHandle, Class<?> parameterTypeClass, LanguageDriver langDriver, String databaseId) { String resultType = nodeToHandle.getStringAttribute("resultType"); Class<?> resultTypeClass = resolveClass(resultType); StatementType statementType = StatementType.valueOf(nodeToHandle.getStringAttribute("statementType", StatementType.PREPARED.toString())); String keyProperty = nodeToHandle.getStringAttribute("keyProperty"); String keyColumn = nodeToHandle.getStringAttribute("keyColumn"); boolean executeBefore = "BEFORE".equals(nodeToHandle.getStringAttribute("order", "AFTER")); //defaults boolean useCache = false; boolean resultOrdered = false; KeyGenerator keyGenerator = new NoKeyGenerator(); Integer fetchSize = null; Integer timeout = null; boolean flushCache = false; String parameterMap = null; String resultMap = null; ResultSetType resultSetTypeEnum = null; SqlSource sqlSource = langDriver.createSqlSource(configuration, nodeToHandle, parameterTypeClass); SqlCommandType sqlCommandType = SqlCommandType.SELECT; builderAssistant.addMappedStatement(id, sqlSource, statementType, sqlCommandType, fetchSize, timeout, parameterMap, parameterTypeClass, resultMap, resultTypeClass, resultSetTypeEnum, flushCache, useCache, resultOrdered, keyGenerator, keyProperty, keyColumn, databaseId, langDriver, null); id = builderAssistant.applyCurrentNamespace(id, false); MappedStatement keyStatement = configuration.getMappedStatement(id, false); configuration.addKeyGenerator(id, new SelectKeyGenerator(keyStatement, executeBefore)); }
Example #18
Source File: MapperAnnotationBuilder.java From mybaties with Apache License 2.0 | 5 votes |
private SqlSource buildSqlSourceFromStrings(String[] strings, Class<?> parameterTypeClass, LanguageDriver languageDriver) { final StringBuilder sql = new StringBuilder(); for (String fragment : strings) { sql.append(fragment); sql.append(" "); } return languageDriver.createSqlSource(configuration, sql.toString(), parameterTypeClass); }
Example #19
Source File: XMLStatementBuilder.java From mybatis with Apache License 2.0 | 5 votes |
private void parseSelectKeyNodes(String parentId, List<XNode> list, Class<?> parameterTypeClass, LanguageDriver langDriver, String skRequiredDatabaseId) { for (XNode nodeToHandle : list) { String id = parentId + SelectKeyGenerator.SELECT_KEY_SUFFIX; String databaseId = nodeToHandle.getStringAttribute("databaseId"); if (databaseIdMatchesCurrent(id, databaseId, skRequiredDatabaseId)) { parseSelectKeyNode(id, nodeToHandle, parameterTypeClass, langDriver, databaseId); } } }
Example #20
Source File: XMLStatementBuilder.java From mybatis with Apache License 2.0 | 5 votes |
private void processSelectKeyNodes(String id, Class<?> parameterTypeClass, LanguageDriver langDriver) { List<XNode> selectKeyNodes = context.evalNodes("selectKey"); if (configuration.getDatabaseId() != null) { parseSelectKeyNodes(id, selectKeyNodes, parameterTypeClass, langDriver, configuration.getDatabaseId()); } parseSelectKeyNodes(id, selectKeyNodes, parameterTypeClass, langDriver, null); removeSelectKeyNodes(selectKeyNodes); }
Example #21
Source File: MapperAnnotationBuilder.java From mybatis with Apache License 2.0 | 5 votes |
private SqlSource buildSqlSourceFromStrings(String[] strings, Class<?> parameterTypeClass, LanguageDriver languageDriver) { final StringBuilder sql = new StringBuilder(); for (String fragment : strings) { sql.append(fragment); sql.append(" "); } return languageDriver.createSqlSource(configuration, sql.toString(), parameterTypeClass); }
Example #22
Source File: MapperAnnotationBuilder.java From mybatis with Apache License 2.0 | 5 votes |
private KeyGenerator handleSelectKeyAnnotation(SelectKey selectKeyAnnotation, String baseStatementId, Class<?> parameterTypeClass, LanguageDriver languageDriver) { String id = baseStatementId + SelectKeyGenerator.SELECT_KEY_SUFFIX; Class<?> resultTypeClass = selectKeyAnnotation.resultType(); StatementType statementType = selectKeyAnnotation.statementType(); String keyProperty = selectKeyAnnotation.keyProperty(); String keyColumn = selectKeyAnnotation.keyColumn(); boolean executeBefore = selectKeyAnnotation.before(); // defaults boolean useCache = false; KeyGenerator keyGenerator = new NoKeyGenerator(); Integer fetchSize = null; Integer timeout = null; boolean flushCache = false; String parameterMap = null; String resultMap = null; ResultSetType resultSetTypeEnum = null; SqlSource sqlSource = buildSqlSourceFromStrings(selectKeyAnnotation.statement(), parameterTypeClass, languageDriver); SqlCommandType sqlCommandType = SqlCommandType.SELECT; assistant.addMappedStatement(id, sqlSource, statementType, sqlCommandType, fetchSize, timeout, parameterMap, parameterTypeClass, resultMap, resultTypeClass, resultSetTypeEnum, flushCache, useCache, false, keyGenerator, keyProperty, keyColumn, null, languageDriver, null); id = assistant.applyCurrentNamespace(id, false); MappedStatement keyStatement = configuration.getMappedStatement(id, false); SelectKeyGenerator answer = new SelectKeyGenerator(keyStatement, executeBefore); configuration.addKeyGenerator(id, answer); return answer; }
Example #23
Source File: MapperBuilderAssistant.java From mybatis with Apache License 2.0 | 5 votes |
public LanguageDriver getLanguageDriver(Class<?> langClass) { if (langClass != null) { //注册语言驱动 configuration.getLanguageRegistry().register(langClass); } else { //如果为null,则取得默认驱动(mybatis3.2以前大家一直用的方法) langClass = configuration.getLanguageRegistry().getDefaultDriverClass(); } //再去调configuration return configuration.getLanguageRegistry().getDriver(langClass); }
Example #24
Source File: JobsDatabaseAutoConfiguration.java From zuihou-admin-boot with Apache License 2.0 | 5 votes |
public JobsDatabaseAutoConfiguration(MybatisPlusProperties properties, DatabaseProperties databaseProperties, ObjectProvider<Interceptor[]> interceptorsProvider, ObjectProvider<TypeHandler[]> typeHandlersProvider, ObjectProvider<LanguageDriver[]> languageDriversProvider, ResourceLoader resourceLoader, ObjectProvider<DatabaseIdProvider> databaseIdProvider, ObjectProvider<List<ConfigurationCustomizer>> configurationCustomizersProvider, ObjectProvider<List<MybatisPlusPropertiesCustomizer>> mybatisPlusPropertiesCustomizerProvider, ApplicationContext applicationContext) { super(properties, databaseProperties, interceptorsProvider, typeHandlersProvider, languageDriversProvider, resourceLoader, databaseIdProvider, configurationCustomizersProvider, mybatisPlusPropertiesCustomizerProvider, applicationContext); log.debug("检测到 zuihou.database.multiTenantType!=DATASOURCE,加载了 AuthorityDatabaseAutoConfiguration"); }
Example #25
Source File: OauthDatabaseAutoConfiguration.java From zuihou-admin-cloud with Apache License 2.0 | 5 votes |
public OauthDatabaseAutoConfiguration(MybatisPlusProperties properties, DatabaseProperties databaseProperties, ObjectProvider<Interceptor[]> interceptorsProvider, ObjectProvider<TypeHandler[]> typeHandlersProvider, ObjectProvider<LanguageDriver[]> languageDriversProvider, ResourceLoader resourceLoader, ObjectProvider<DatabaseIdProvider> databaseIdProvider, ObjectProvider<List<ConfigurationCustomizer>> configurationCustomizersProvider, ObjectProvider<List<MybatisPlusPropertiesCustomizer>> mybatisPlusPropertiesCustomizerProvider, ApplicationContext applicationContext) { super(properties, databaseProperties, interceptorsProvider, typeHandlersProvider, languageDriversProvider, resourceLoader, databaseIdProvider, configurationCustomizersProvider, mybatisPlusPropertiesCustomizerProvider, applicationContext); log.debug("检测到 zuihou.database.multiTenantType!=DATASOURCE,启用了 AuthorityDatabaseAutoConfiguration"); }
Example #26
Source File: DemoDatabaseAutoConfiguration.java From zuihou-admin-cloud with Apache License 2.0 | 5 votes |
public DemoDatabaseAutoConfiguration(MybatisPlusProperties properties, DatabaseProperties databaseProperties, ObjectProvider<Interceptor[]> interceptorsProvider, ObjectProvider<TypeHandler[]> typeHandlersProvider, ObjectProvider<LanguageDriver[]> languageDriversProvider, ResourceLoader resourceLoader, ObjectProvider<DatabaseIdProvider> databaseIdProvider, ObjectProvider<List<ConfigurationCustomizer>> configurationCustomizersProvider, ObjectProvider<List<MybatisPlusPropertiesCustomizer>> mybatisPlusPropertiesCustomizerProvider, ApplicationContext applicationContext) { super(properties, databaseProperties, interceptorsProvider, typeHandlersProvider, languageDriversProvider, resourceLoader, databaseIdProvider, configurationCustomizersProvider, mybatisPlusPropertiesCustomizerProvider, applicationContext); log.debug("检测到 zuihou.database.multiTenantType!=DATASOURCE,启用了 AuthorityDatabaseAutoConfiguration"); }
Example #27
Source File: FileDatabaseAutoConfiguration.java From zuihou-admin-cloud with Apache License 2.0 | 5 votes |
public FileDatabaseAutoConfiguration(MybatisPlusProperties properties, DatabaseProperties databaseProperties, ObjectProvider<Interceptor[]> interceptorsProvider, ObjectProvider<TypeHandler[]> typeHandlersProvider, ObjectProvider<LanguageDriver[]> languageDriversProvider, ResourceLoader resourceLoader, ObjectProvider<DatabaseIdProvider> databaseIdProvider, ObjectProvider<List<ConfigurationCustomizer>> configurationCustomizersProvider, ObjectProvider<List<MybatisPlusPropertiesCustomizer>> mybatisPlusPropertiesCustomizerProvider, ApplicationContext applicationContext) { super(properties, databaseProperties, interceptorsProvider, typeHandlersProvider, languageDriversProvider, resourceLoader, databaseIdProvider, configurationCustomizersProvider, mybatisPlusPropertiesCustomizerProvider, applicationContext); }
Example #28
Source File: AuthorityDatabaseAutoConfiguration.java From zuihou-admin-cloud with Apache License 2.0 | 5 votes |
public AuthorityDatabaseAutoConfiguration(MybatisPlusProperties properties, DatabaseProperties databaseProperties, ObjectProvider<Interceptor[]> interceptorsProvider, ObjectProvider<TypeHandler[]> typeHandlersProvider, ObjectProvider<LanguageDriver[]> languageDriversProvider, ResourceLoader resourceLoader, ObjectProvider<DatabaseIdProvider> databaseIdProvider, ObjectProvider<List<ConfigurationCustomizer>> configurationCustomizersProvider, ObjectProvider<List<MybatisPlusPropertiesCustomizer>> mybatisPlusPropertiesCustomizerProvider, ApplicationContext applicationContext) { super(properties, databaseProperties, interceptorsProvider, typeHandlersProvider, languageDriversProvider, resourceLoader, databaseIdProvider, configurationCustomizersProvider, mybatisPlusPropertiesCustomizerProvider, applicationContext); log.debug("检测到 zuihou.database.multiTenantType!=DATASOURCE,加载了 AuthorityDatabaseAutoConfiguration"); }
Example #29
Source File: MybatisMapperBuildAssistant.java From spring-data-mybatis with Apache License 2.0 | 5 votes |
/** * build sql source for mybatis from string concat by array. */ protected SqlSource buildSqlSourceFromStrings(String[] strings, Class<?> parameterTypeClass) { final StringBuilder sql = new StringBuilder(); for (String fragment : strings) { sql.append(fragment); sql.append(" "); } LanguageDriver languageDriver = getLanguageDriver(); return languageDriver.createSqlSource(configuration, sql.toString().trim(), parameterTypeClass); }
Example #30
Source File: MybatisMapperBuildAssistant.java From spring-data-mybatis with Apache License 2.0 | 5 votes |
protected void addMappedStatement(String id, SqlSource sqlSource, StatementType statementType, SqlCommandType sqlCommandType, Integer fetchSize, Integer timeout, String parameterMap, Class<?> parameterType, String resultMap, Class<?> resultType, ResultSetType resultSetType, boolean flushCache, boolean useCache, boolean resultOrdered, KeyGenerator keyGenerator, String keyProperty, String keyColumn, String databaseId, LanguageDriver lang, String resultSets) { assistant.addMappedStatement(id, sqlSource, statementType, sqlCommandType, fetchSize, timeout, parameterMap, parameterType, resultMap, resultType, resultSetType, flushCache, useCache, resultOrdered, keyGenerator, keyProperty, keyColumn, databaseId, lang, resultSets); }