当前位置:网站首页>Myormframeworkjdbc review and problem analysis of user-defined persistence layer framework, and thought analysis of user-defined persistence layer framework
Myormframeworkjdbc review and problem analysis of user-defined persistence layer framework, and thought analysis of user-defined persistence layer framework
2022-07-25 20:10:00 【51CTO】
JDBC Review and problem analysis

Design idea of custom persistence layer framework
End of use ( project )
- Introducing a custom persistence layer framework jar package
- Provides two parts of configuration information : Database configuration information 、sql Configuration information :sql sentence 、 Parameter type 、 The return value type uses the configuration file to provide these two parts of configuration information :
- sqlMapConfg.xml: Store database configuration information , Deposit mapper.xml The full path of
- mapper.xml: Deposit sql Configuration information
Customize the persistence layer framework itself ( engineering )
The essence is right JDBC The code is encapsulated
- Load profile : According to the path of the configuration file , Load configuration file into byte input stream , Stored in memory
establish Resources Class method :InputSteam getResourceAsSteam(String path)
- Create two javaBean:( Container object )∶ What is stored is the content parsed from the configuration file
Configuration: Core configuration class : Deposit sqIMapConfg.xml What's coming out of it
MappedStatement: Mapping configuration class : Deposit mapper.xml What's coming out of it
- Parse configuration file : dom4j
Create a class :SqlSessionFactoryBuilder Method :build(InputSteam in)
First of all : Use dom4j Parse configuration file , Encapsulate the parsed content into the container object
second : establish SqlSessionFactory object ; production sqlSession : Conversation object ( Factory mode )
- establish SqlSessionFactory Interface and implementation class DefaultSqISessionFacotry
openSession(): production sqlSession
- establish SqlSession Interface and implementation class DefaultSession
Define the database crud operation : selectList()
selectOne()
update()
delete()
insert()
- establish Executor Interface and implementation class SimpleExecutor Implementation class
query(Confguration,MappedStatement,Object… params): What we're doing is JDBC Code
This is the end of this article ,
If you have any harvest, you are welcome to like, collect and pay attention to ️, Your encouragement is my biggest motivation .
If you have any wrong questions, you are welcome to point out .
Home page : Share a cup of no blog summaryKeep loving , Go to the next mountain and sea .

边栏推荐
- Aircraft PID control (rotor flight control)
- [today in history] July 1: the father of time-sharing system was born; Alipay launched barcode payment; The first TV advertisement in the world
- tiktok如何破零播放?
- Recommended system topic | Minet: cross domain CTR prediction
- Jmeter——接口测试
- 使用cookie登录百度网盘(网站使用cookie)
- 03 isomorphism of tree 1
- Network RTK UAV test [easy to understand]
- [today in history] July 4: the first e-book came out; The inventor of magnetic stripe card was born; Palm computer pioneer was born
- Web crawler principle analysis "suggestions collection"
猜你喜欢

Shopping guide for high-end flagship projectors: dangbei X3 pro and dangbei F5 are more immersive!

wallys//IPQ5018/IPQ6010/PD-60 802.3AT Input Output 10/100/1000M

RepVGG网络中重参化网络结构解读【附代码】

4everland storage node portal network design
![[advanced mathematics] [3] Application of differential mean value theorem and derivative](/img/a9/3b024dbbb201bee4eed6c9f6ce3001.png)
[advanced mathematics] [3] Application of differential mean value theorem and derivative

PreScan快速入门到精通第十九讲之PreScan执行器配置、轨迹同步及非配多个轨迹

Security Basics 4 - regular expressions

Stochastic gradient descent method, Newton method, impulse method, adagrad, rmsprop and Adam optimization process and understanding

PreScan快速入门到精通第十八讲之PreScan轨迹编辑的特殊功能
![[advanced mathematics] [4] indefinite integral](/img/4f/2aae654599fcc0ee85cb1ba46c9afd.png)
[advanced mathematics] [4] indefinite integral
随机推荐
[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay
Notes - record a cannotfinddatasourceexception: dynamic datasource can not find primary datasource problem solving
wallys//wifi6 wifi5 router IPQ6018 IPQ4019 IPQ4029 802.11ax 802.11ac
Redis source code -ziplist
Digital informatization (enumerate assumptions first, and then see whether the conditions are met) (1089 werewolf kill - simple version)
Yyds dry inventory how to locate browser page crash
[today in history] June 30: von Neumann published the first draft; The semiconductor war in the late 1990s; CBS acquires CNET
Three skills of interface request merging, and the performance is directly exploded!
4everland storage node portal network design
[Infographics Show] 248 Public Domain Name
【云原生 | 从零开始学Kubernetes】八、命名空间资源配额以及标签
Distributed link logging minbox logging usage document
Pytorch's transforms (numpy data type is converted to tensor, normalized and resized)
Export and call of onnx file of pytorch model
Sentinel simple current limiting and degradation demo problem record
PMP采用最新考纲,这里有【敏捷项目管理】
当AI邂逅生命健康,华为云为他们搭建三座桥
10.< tag-动态规划和子序列, 子数组>lt.53. 最大子数组和 + lt.392. 判断子序列 dbc
Application of conductive slip ring in mechanical equipment
[today in history] June 29: SGI and MIPS merged; Microsoft acquires PowerPoint developer; News corporation sells MySpace