Class ProviderSqlSource

  • All Implemented Interfaces:
    SqlSource

    public class ProviderSqlSource
    extends java.lang.Object
    implements SqlSource
    • Field Detail

      • providerType

        private final java.lang.Class<?> providerType
      • 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
      • providerContextIndex

        private final java.lang.Integer providerContextIndex
    • Constructor Detail

      • 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 the ProviderSqlSource(Configuration, Annotation, Class, Method) instead of this.
        This constructor will remove at a future version.
        Parameters:
        configuration - the configuration
        provider - the provider
        mapperType - the mapper type
        mapperMethod - 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 configuration
        provider - the provider
        mapperType - the mapper type
        mapperMethod - the mapper method
        Since:
        3.5.3
    • Method Detail

      • 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