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

边栏推荐
- From Tong Dai to "Tong Dai" and then to brand, the beauty of sudden profits has changed and remained unchanged
- redis源码 -ziplist
- PMP practice once a day | don't get lost in the exam -7.25
- The query data returned by the print database is null or the default value. Does not match the value returned by the database
- 一元函数积分学_分部积分法
- 【高等数学】【8】微分方程
- DIY personal server (DIY storage server)
- Analysis of CMS station building system of common PHP in China
- Difference Between Accuracy and Precision
- 导电滑环在机械设备方面的应用
猜你喜欢
![[cloud native | learn kubernetes from scratch] VIII. Namespace resource quotas and labels](/img/7e/2bdead512ba5bf5ccd0830b0f9b0f2.png)
[cloud native | learn kubernetes from scratch] VIII. Namespace resource quotas and labels

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

【高等数学】【4】不定积分

Docker 搭建 Redis Cluster集群
![[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay](/img/18/b06e2e5a2f76dc2da1c2374b8424b3.png)
[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay

Application of conductive slip ring in mechanical equipment

Socket error Event: 32 Error: 10053. Connection closing...Socket close
![[today in history] July 4: the first e-book came out; The inventor of magnetic stripe card was born; Palm computer pioneer was born](/img/0b/73f0d98a6db813e54074abe199ed98.png)
[today in history] July 4: the first e-book came out; The inventor of magnetic stripe card was born; Palm computer pioneer was born

test

谷歌Pixel 6a屏下指纹扫描仪存在重大安全漏洞
随机推荐
What is cluster analysis? Categories of cluster analysis methods [easy to understand]
【云原生 | 从零开始学Kubernetes】八、命名空间资源配额以及标签
Authorized wireless communication standard
JS作用域与作用域链
[today in history] July 3: ergonomic standards act; The birth of pioneers in the field of consumer electronics; Ubisoft releases uplay
4、Nacos 配置中心源码解析之 服务端启动
RF, gbdt, xgboost feature selection methods "recommended collection"
03 isomorphism of tree 1
QML combines qsqltablemodel to dynamically load data MVC "recommended collection"
Technology cloud report: more than zero trust, the wild hope of Parra's "Digital Security Cloud strategy"
How does tiktok break zero?
【高等数学】【1】函数、极限、连续
Detailed evaluation of current popular redis visual management tools
Proxy implements MySQL read / write separation
When AI encounters life and health, Huawei cloud builds three bridges for them
[today in history] June 30: von Neumann published the first draft; The semiconductor war in the late 1990s; CBS acquires CNET
The query data returned by the print database is null or the default value. Does not match the value returned by the database
10.< tag-动态规划和子序列, 子数组>lt.53. 最大子数组和 + lt.392. 判断子序列 dbc
Notes - record a cannotfinddatasourceexception: dynamic datasource can not find primary datasource problem solving
[today in history] July 1: the father of time-sharing system was born; Alipay launched barcode payment; The first TV advertisement in the world