Class ProviderSqlSource
- java.lang.Object
-
- org.apache.ibatis.builder.annotation.ProviderSqlSource
-
-
Field Summary
Fields Modifier and Type Field Description private Configuration
configuration
private LanguageDriver
languageDriver
private java.lang.reflect.Method
mapperMethod
private ProviderContext
providerContext
private java.lang.Integer
providerContextIndex
private java.lang.reflect.Method
providerMethod
private java.lang.String[]
providerMethodArgumentNames
private java.lang.Class<?>[]
providerMethodParameterTypes
private java.lang.Class<?>
providerType
-
Constructor Summary
Constructors Constructor Description ProviderSqlSource(Configuration configuration, java.lang.annotation.Annotation provider, java.lang.Class<?> mapperType, java.lang.reflect.Method mapperMethod)
Instantiates a new provider sql source.ProviderSqlSource(Configuration configuration, java.lang.Object provider)
Deprecated.Since 3.5.3, Please use theProviderSqlSource(Configuration, Annotation, Class, Method)
instead of this.ProviderSqlSource(Configuration configuration, java.lang.Object provider, java.lang.Class<?> mapperType, java.lang.reflect.Method mapperMethod)
Deprecated.Since 3.5.3, Please use theProviderSqlSource(Configuration, Annotation, Class, Method)
instead of this.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private SqlSource
createSqlSource(java.lang.Object parameterObject)
private java.lang.Object[]
extractProviderMethodArguments(java.lang.Object parameterObject)
private java.lang.Object[]
extractProviderMethodArguments(java.util.Map<java.lang.String,java.lang.Object> params, java.lang.String[] argumentNames)
private java.lang.Throwable
extractRootCause(java.lang.Exception e)
BoundSql
getBoundSql(java.lang.Object parameterObject)
private java.lang.Class<?>
getProviderType(Configuration configuration, java.lang.annotation.Annotation providerAnnotation, java.lang.reflect.Method mapperMethod)
private java.lang.String
invokeProviderMethod(java.lang.Object... args)
-
-
-
Field Detail
-
configuration
private final Configuration configuration
-
providerType
private final java.lang.Class<?> providerType
-
languageDriver
private final LanguageDriver languageDriver
-
mapperMethod
private final java.lang.reflect.Method mapperMethod
-
providerMethod
private final java.lang.reflect.Method providerMethod
-
providerMethodArgumentNames
private final java.lang.String[] providerMethodArgumentNames
-
providerMethodParameterTypes
private final java.lang.Class<?>[] providerMethodParameterTypes
-
providerContext
private final ProviderContext providerContext
-
providerContextIndex
private final java.lang.Integer providerContextIndex
-
-
Constructor Detail
-
ProviderSqlSource
@Deprecated public ProviderSqlSource(Configuration configuration, java.lang.Object provider)
Deprecated.Since 3.5.3, Please use theProviderSqlSource(Configuration, Annotation, Class, Method)
instead of this.This constructor will remove at a future version.- Parameters:
configuration
- the configurationprovider
- the provider
-
ProviderSqlSource
@Deprecated public ProviderSqlSource(Configuration configuration, java.lang.Object provider, java.lang.Class<?> mapperType, java.lang.reflect.Method mapperMethod)
Deprecated.Since 3.5.3, Please use theProviderSqlSource(Configuration, Annotation, Class, Method)
instead of this.This constructor will remove at a future version.- Parameters:
configuration
- the configurationprovider
- the providermapperType
- the mapper typemapperMethod
- the mapper method- Since:
- 3.4.5
-
ProviderSqlSource
public ProviderSqlSource(Configuration configuration, java.lang.annotation.Annotation provider, java.lang.Class<?> mapperType, java.lang.reflect.Method mapperMethod)
Instantiates a new provider sql source.- Parameters:
configuration
- the configurationprovider
- the providermapperType
- the mapper typemapperMethod
- the mapper method- Since:
- 3.5.3
-
-
Method Detail
-
getBoundSql
public BoundSql getBoundSql(java.lang.Object parameterObject)
- Specified by:
getBoundSql
in interfaceSqlSource
-
createSqlSource
private SqlSource createSqlSource(java.lang.Object parameterObject)
-
extractRootCause
private java.lang.Throwable extractRootCause(java.lang.Exception e)
-
extractProviderMethodArguments
private java.lang.Object[] extractProviderMethodArguments(java.lang.Object parameterObject)
-
extractProviderMethodArguments
private java.lang.Object[] extractProviderMethodArguments(java.util.Map<java.lang.String,java.lang.Object> params, java.lang.String[] argumentNames)
-
invokeProviderMethod
private java.lang.String invokeProviderMethod(java.lang.Object... args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getProviderType
private java.lang.Class<?> getProviderType(Configuration configuration, java.lang.annotation.Annotation providerAnnotation, java.lang.reflect.Method mapperMethod) throws java.lang.NoSuchMethodException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
- Throws:
java.lang.NoSuchMethodException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
-
-