mybatis源码分析
2020-11-23 01:28:00 0 举报
mybatis源码分析
作者其他创作
大纲/内容
默认值:\"http://java.sun.com/jaxp/xpath/dom\"
Document
。。。
6
defaultSqlSession有指定的configuration
9. 等11走完直接返回config
SecuritySupport
getSystemProperty(final String propName)
UserMapper mapper = sqlSession.getMapper(UserMapper.class);
XPathFactory
DEFAULT_OBJECT_MODEL_UR
newInstance();newInstance(DEFAULT_OBJECT_MODEL_URI);
自定义的Mapper.class
null
new XMLMapperEntityResolver()
10.2
true
MapperProxyFactory<T>
(MapperProxyFactory<T>) V get(Object key);T newInstance(SqlSession sqlSession) protected T newInstance(MapperProxy<T> mapperProxy)
7
18
要在安全支持下(访问系统资源):在当前访问权限下查看系统属性中是否有这个属性的值
5
给当前类的configuration配置参数
10.3 f
2
XMLConfigBuilder
private final XPathParser parser;
AccessController
doPrivileged(PrivilegedAction<T> action)
XPathParser
private final Document document; private boolean validation; private EntityResolver entityResolver; private Properties variables; private XPath xpath;
10.1
SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build( UserTest.class.getClassLoader().getResourceAsStream(\"mybatis-config.xml\"));
13 将config传进新类
4
XPathFactoryFinder
XPathFactory newFactory(String uri) private XPathFactory _newFactory(String uri) XPathFactory createInstance(String className)
Configuration
MapperRegistry mapperRegistry = new MapperRegistry(this);
DefaultSqlSessionFactory implements SqlSessionFactory
1
15
14
枚举类型ExecutorType.SIMPLE
16
DefaultSqlSessionFactory(config)
这个方法通过类的全路径进行反射来获取实例
SqlSession sqlSession = sqlSessionFactory.openSession(true);
17 config传进去
DefaultSqlSession
8
SqlSessionFactoryBuilder
MapperRegistry
19
MapperProxy<T>
20
XNode
private final Node node; private final String name; private final String body; private final Properties attributes; private final Properties variables; private final XPathParser xpathParser;
3
12
11
收藏
0 条评论
下一页