
MyBatis
个人学习MyBatis总结
javalj_hz
一个
展开
-
TypeAliasRegistry 处理别名问题
package org.apache.ibatis.reflection.property;import java.lang.reflect.Field;/** * @author Clinton Begin */public final class PropertyCopier { private PropertyCopier() { // Prevent Inst...原创 2019-09-17 14:27:45 · 389 阅读 · 0 评论 -
PropertyNamer解析
package org.apache.ibatis.reflection.property;import java.util.Locale;import org.apache.ibatis.reflection.ReflectionException;/** * @author Clinton Begin */public final class PropertyNamer {...原创 2019-09-17 14:23:35 · 1643 阅读 · 0 评论 -
PropertyTokenizer解析
/** * Copyright 2009-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the Lic...原创 2019-09-17 14:18:37 · 567 阅读 · 0 评论 -
DefaultObjectFactory的解析
/** * Copyright 2009-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the Lic...原创 2019-09-17 14:06:48 · 443 阅读 · 0 评论 -
Reflector的解析
/** * Copyright 2009-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the Lic...原创 2019-09-17 13:30:13 · 381 阅读 · 0 评论 -
PropertyParser 的工作原理
/** * Copyright 2009-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the Lic...原创 2019-09-17 11:25:30 · 428 阅读 · 0 评论 -
GenericTokenParser 解析字符串的过程
/** * Copyright 2009-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the Li...原创 2019-09-17 11:13:51 · 729 阅读 · 0 评论 -
XMLMapperEntityResolver加载DTD过程
如果解析 mybatis-config .xm l 配置文件,默认联网加载http://mybatis.org/dtd/mybatis-3-config.dtd 这个 DTD 文档,当网络比较慢时会导致验证过程缓慢。在实践中往往会提前设置 EntityResolver 接口对象加载本地的 DTD 文件,从而避免联网加载DTD 文件。/** * Copyright 2009-2016...原创 2019-09-17 10:48:16 · 534 阅读 · 0 评论 -
Mybatis基础配置以及元素
配置<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"><configurat...原创 2019-09-16 16:54:34 · 99 阅读 · 0 评论 -
MyBatis基础配置
MyBatis基础配置<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"><c...原创 2019-09-16 16:09:55 · 111 阅读 · 0 评论 -
Spring+MyBatis 集成
Spring+MyBatis 集成<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www....原创 2019-09-16 15:56:51 · 111 阅读 · 0 评论 -
MyBatis运行原理
MyBatis运行原理分成两部分读取配置文件缓存到Configuration对象,用于创建SqlSessionFactorySqlSession执行过程构建SqlSessionFactorySqlSessionFactory是MyBatis核心类之一,其作用是提供创建SqlSession的能力。创建SqlSessionFactory需要通过SqlSessionFactoryBuil...原创 2019-09-16 15:04:43 · 152 阅读 · 0 评论 -
MyBatis动态sql
动态sql动态sql是为了解决sql拼接的问题,体现了mybatis组装代码的能力元素介绍元素作用备注if判断语句但条件分支choose(when ,otherwise)相当于java的switch多条件判断foreach循环语句相当于fortrim(where,set)辅助元素处理拼接问题if元素if 相当于java中的if...原创 2019-09-16 12:09:11 · 88 阅读 · 0 评论 -
MyBatis缓存
MyBatis文章总结缓存一级缓存mybaits在不配置的情况下默认开启一级缓存,即sqlsession层面的缓存。在参数和sql相同的情况下,我们使用同一个sqlsession访问同一个mapper方法,往往只执行一次sql.因为在第一次查询之后,mybatis会将数据缓存到缓存中,后续查询中,如果缓存没有过期,或者声明刷新,sqlsession会访问缓存,不会去数据库中查询。...原创 2019-09-16 11:08:03 · 75 阅读 · 0 评论 -
TypeHandlerRegistry 注册handler
age org.apache.ibatis.type;import java.io.InputStream;import java.io.Reader;import java.lang.reflect.Constructor;import java.lang.reflect.Modifier;import java.lang.reflect.Type;import java.math....原创 2019-09-17 15:02:12 · 1672 阅读 · 1 评论