In-depth explanation of MyBatis technical principles and practical Chinese catalog

Author: Yang Kaizhen http://blog.csdn.net/ykzhen2015
Cover 1
Preface 5
Contents 8
Chapter 1 MyBatis Introduction 13
1.1 Traditional JDBC Programming 13
1.2 ORM Model 16
1.3 Hibernate 16
1.4 MyBatis 21
1.5 When to Use MyBatis 24
2 Chapter Getting Started with MyBaits 25
2.1 Development Environment Preparation. 25
2.1.1 Download MyBatis 25
2.1.2 Build a Development Environment 26
2.2 Basic Components of MyBatis 27
2.2.1 Build SqlSessionFactory 27
2.2.2 Create SqlSession 31
2.2.3 Mapper 33
2.3 Life Cycle 38
2.3.1 SqlSessionFactoryBuilder 39
2.3.2 SqlSessionFactory 39
2.3.3 SqlSession 39
2.3.4 Mapper 40
2.4 Instance 40
Chapter 3 Configuration 49
3.1 properties element 50
3.1.1 property sub-element. 50
3.1.2 properties configuration file 51
3.1.3 program parameter passing 51
3.1.4 priority 52
3.2 settings 53
3.3 aliases 56
3.3.1 system-defined aliases 56
3.3.2 custom aliases 59
3.4 typeHandler Type handlers. 60
3.4.1 System-defined typeHandlers 61
3.4.2 Custom typeHandlers 63
3.4.3 Enumerated type typeHandlers 67
3.5 ObjectFactory 74
3.6 Plugins 77
3.7 environments Configuration environments 77
3.7.1 Overview 77
3.7.2 Database transactions 78
3.7.3 Data sources 79
3.8 databaseIdProvider database vendor identifier 80
3.8.1 Use system default rules 80
3.8.2 Do not use system default rules 81
3.9 Methods for introducing mappers 83
Chapter 4 Mappers 85
4.1 Main elements of mappers 85
4.2 select element 86
4.2.1 Overview 86
4.2.2 Examples of simple data types 87
4.2.3 Automatic mapping. 88
4.2.4 Passing multiple parameters 90
4.2.5 Mapping result sets using resultMap 93
4.3 insert elements 94
4.3.1 Overview 94
4.3.2 Primary key backfill and customization 101
_
_
_
_
_
_
_
4.7.1 The composition of resultMap elements 101
4.7.2 Using map to store result set 103
4.7.3 Using POJO to store result set 103
4.7.4 Cascading 104
4.8 Cache cache 125
4.8.1 System cache (first-level cache and second-level cache) 125
4.8.2 Custom caches 129
Chapter 5 Dynamic SQL 131
5.1 Overview 131
5.2 if elements 132
5.3 choose, when, otherwise elements 132
5.4 trim, where, set elements 133
5.5 foreach element 135
5.6 test attribute 136
5.7 bind element 137
Chapter 6 MyBatis analysis and operation principle 139
6.1 Introduction to technical difficulties involved 140
6.1.1 Reflection technology 141
6.1.2 JDK dynamic proxy. 142
6.1.3 CGLIB dynamic proxy 145
6.2 The process of building SqlSessionFactory 146
6.2.1 Building Configuration 147
6.2.2 Internal composition of mapper 148
6.2.3 Building SqlSessionFactory 150
6.3 SqlSession running process 150
6.3.1 Dynamic proxy of mapper 150
6.3.2 Four major objects under SqlSession 154
6.3.3 SqlSession Operation Summary 162
Chapter 7 Plug-ins. 164
7.1 Plug-in interface 164
7.2 Plug-in initialization 165
7.3 Plug-in proxy and reflection design 166
7.4 Commonly used tool classes - MetaObject 169
7.5 Plug-in development process and examples 171
7.5. 1 Determine the signature that needs to be intercepted 171
7.5.2 Implement interception methods. 173
7.5.3 Configuring and Running 174
7.5.4 Plugin Examples 175
7.6 Summary 178
Chapter 8 MyBatis-Spring 180
8.1 Spring Basics. 180
8.1.1 Spring IOC Basics 181
8.1.2 Spring AOP Basics 183
8.1.3 Spring Transaction Management 185
8.1.4 Spring MVC Basics 191
8.2 MyBatis-Spring Application 193
8.2.1 Overview 193
8.2.2 Configuring SqlSessionFactory 194
8.2.3 Configuring SqlSessionTemplate 196
8.2.4 Configuring Mapper 200
8.2.5 Configuring Transactions 202
8.3 Instances 203
8.3.1 Environment Preparation 203
8.3.2 File Directory 205
8.3.3 Spring Configuration File 206
8.3.4 MyBatis Framework Related Configuration 210
8.3.5 Configure Service Layer 217
8.3.6 Write Controller 221
8.3.7 Test 222
8.4 Summary 222
Chapter 9 Practical Scenario 224
9.1 Database BLOB field read and write 224
9.2 Batch update 227
9.3 Calling stored procedure 229
9.3.1 Use of stored procedure in and out parameters 229
9.3.2 Stored procedure cursor. 232
9.4 Sub-table 237
9.5 Paging 239
9.5.1 RowBounds paging 239
9.5.2 Plug-in paging 241
9.6 Upload File to Server 251
9.7 Using Enumerations in Mappings 259
9.8 Many-to-Many Cascading 261
9.9 Summary 265
Appendix A Database Model Description and Cascading Student Relationships Table Statement 266

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326416654&siteId=291194637