mybatis加载mapper接口过程

spring中mybatis加载mapper接口过程

一、使用注解@MapperScan开始

org.mybatis.spring.annotation.MapperScan

org.mybatis.spring.annotation.MapperScannerRegistrar

  • org.springframework.context.annotation.ImportBeanDefinitionRegistrar

    registerBeanDefinitions

二、注册mapper声明的接口的回调入口 loadBeanDefinitionsFromRegistrars

org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader

←loadBeanDefinitionsForConfigurationClass←loadBeanDefinitions

org.springframework.context.annotation.ConfigurationClassPostProcessor

←postProcessBeanDefinitionRegistry或postProcessBeanFactory回调

org.springframework.context.annotation.AnnotationConfigUtils

←registerAnnotationConfigProcessors

org.springframework.context.annotation.AnnotatedBeanDefinitionReader

←AnnotatedBeanDefinitionReader(org.springframework.beans.factory.support.BeanDefinitionRegistry, org.springframework.core.env.Environment)

org.springframework.web.context.support.AnnotationConfigWebApplicationContext

←getAnnotatedBeanDefinitionReader←loadBeanDefinitions

←org.springframework.context.support.AbstractRefreshableApplicationContext#loadBeanDefinitions

org.springframework.context.support.AbstractApplicationContext

←refreshBeanFactory←obtainFreshBeanFactory←refresh

mybatis加载mapper接口过程

上一篇:appium---判断app页面是否包含webview


下一篇:Android 功耗(3)---高通功耗问题分析方法