当前位置:网站首页>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 .

边栏推荐
- Successfully solved typeerror: a bytes like object is required, not 'str‘
- Formatdatetime explanation [easy to understand]
- Digital informatization (enumerate assumptions first, and then see whether the conditions are met) (1089 werewolf kill - simple version)
- 随机梯度下降法、牛顿法、冲量法、AdaGrad、RMSprop以及Adam优化过程和理解
- "Share" devaxpress asp Net v22.1 latest version system environment configuration requirements
- How to ensure the quality of customized slip rings
- Docker 搭建 Redis Cluster集群
- Technology cloud report: what is the difference between zero trust and SASE? The answer is not really important
- 智能电子界桩自然保护区远程监控解决方案
- 导电滑环在机械设备方面的应用
猜你喜欢

wallys//wifi6 wifi5 router IPQ6018 IPQ4019 IPQ4029 802.11ax 802.11ac

03 isomorphism of tree 1

Recommendations on how to install plug-ins and baby plug-ins in idea

C # add multi line and multi column text watermark in word

Software designer afternoon real topic: 2009-2022

JVM(二十三) -- JVM运行时参数

JVM (XXIII) -- JVM runtime parameters

【高等数学】【3】微分中值定理与导数的应用
![[today in history] July 2: BitTorrent came out; The commercial system linspire was acquired; Sony deploys Playstation now](/img/7d/7a01c8c6923077d6c201bf1ae02c8c.png)
[today in history] July 2: BitTorrent came out; The commercial system linspire was acquired; Sony deploys Playstation now
![[today in history] June 28: musk was born; Microsoft launched office 365; The inventor of Chua's circuit was born](/img/bf/09ccf36caec099098a22f0e8b670bd.png)
[today in history] June 28: musk was born; Microsoft launched office 365; The inventor of Chua's circuit was born
随机推荐
Notes - record a cannotfinddatasourceexception: dynamic datasource can not find primary datasource problem solving
How to ensure the quality of customized slip rings
分享 25 个有用的 JS 单行代码
Recommendations on how to install plug-ins and baby plug-ins in idea
[today in history] June 30: von Neumann published the first draft; The semiconductor war in the late 1990s; CBS acquires CNET
Export and call of onnx file of pytorch model
什么是聚类分析?聚类分析方法的类别[通俗易懂]
Technology cloud report: more than zero trust, the wild hope of Parra's "Digital Security Cloud strategy"
Configure and install cocos2dx development environment under Tongxin UOS
数字信息化(先枚举假设,再看是否满足条件)(1089 狼人杀-简单版)
From Tong Dai to "Tong Dai" and then to brand, the beauty of sudden profits has changed and remained unchanged
股票软件开发
03 isomorphism of tree 1
FormatDateTime说解[通俗易懂]
tga文件格式(波形声音文件格式)
如何保证定制滑环质量
[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay
Formatdatetime explanation [easy to understand]
Difference Between Accuracy and Precision
PMP每日一练 | 考试不迷路-7.25