Mybatis技术内幕读书笔记(七)MappedStatement的解析

 

 

Mybatis技术内幕读书笔记(七)MappedStatement的解析

Mybatis技术内幕读书笔记(七)MappedStatement的解析

Mybatis技术内幕读书笔记(七)MappedStatement的解析

Mybatis技术内幕读书笔记(七)MappedStatement的解析

Mybatis技术内幕读书笔记(七)MappedStatement的解析

Mybatis技术内幕读书笔记(七)MappedStatement的解析

Mybatis技术内幕读书笔记(七)MappedStatement的解析

Mybatis技术内幕读书笔记(七)MappedStatement的解析

Mybatis技术内幕读书笔记(七)MappedStatement的解析

Mybatis技术内幕读书笔记(七)MappedStatement的解析

Mybatis技术内幕读书笔记(七)MappedStatement的解析

Mybatis技术内幕读书笔记(七)MappedStatement的解析

Mybatis技术内幕读书笔记(七)MappedStatement的解析

Mybatis技术内幕读书笔记(七)MappedStatement的解析

Mybatis技术内幕读书笔记(七)MappedStatement的解析

总结:MappedStatement包含了id,sqlSource和sqltype,SqlSource包含了一个dynamiccontext和sqlnode,dynamiccontext里面有sqlbuilder,然后mybatis根据xpath解析xm与用户参数来构建sqlnode的树状结构,sqlnode解析完成后会把解析好的sql语句追加到dynamiccontext里的sqlbuilder,最终完成sql解析。