MyBatis Parameter Passing: Trensferring parameters from Java code to mapper.xml files. Single Simple Parameter When a DAO interface method contains only one simple parameter (Java primitive type or String), the placeholder #{any_text} can be used, and it is independent of the method's parameter name...
Introduction MyBatis serves as a persistence framework that simplifies database operations by eliminating repetitive tasks associated with traditional JDBC usage. It allows developers to focus more on business logic rather than boilerplate code, offering flexible SQL construction and result mapping...
Understanding design patterns theoretically often differs from observing their practical application in large-scale frameworks. While there are 23 standard patterns, developers frequently encounter them more clearly within mature source codebases like Mybatis. Analyzing these internals reveals how c...
Understanding Frameworks A framework is a reusable design structure that defines the architecture of an application, outlining dependencies, responsibilities, and control flow among components. It serves as a foundation upon which developers build applications, abstracting common functionalities to...
Core Concepts of MyBatis MyBatis is a persistence framework for Java that enables custom SQL, stored procedures, and advanced object-relational mapping. Unlike full ORM tools like Hibernate, it focuses on flexible SQL control through configuration and ennotations, bridging Java objects and database...
Maven Dependency Add the following dependency to your pom.xml file: <dependency> <groupId>tk.mybatis</groupId> <artifactId>mapper-spring-boot-starter</artifactId> <version>2.1.5</version> </dependency> Deifning Mappper Interfaces Create mapper interfac...
Technology Stack Backend with Spring Boot Spring Boot simplifies application development by offering auto-configuration and embedded server support. Below is an example of a minimal REST controller implementation: import org.springframework.boot.SpringApplication; import org.springframework.boot.aut...
Introduction to MyBatis Generator MyBatis Generator (MBG), also referred to as MyBatis reverse engineering, is a specialized code generator designed for MyBatis framework users. It can rapidly generate corresponding mapping files, interfaces, and bean classes based on database tables. While it suppo...
Mapper Mapping File <?xml version="1.0" encoding="UTF-8" ?> <mapper namespace="EmployeeMapper"> <!-- Return type for insert/update/delete is `int`, so `resultType` is not needed. `insert`, `update`, `delete` tags don't have `resultType` but support `param...
Backend Architecture with Spring Boot Spring Boot serves as the backbone for the study room management system, providing a robust environment for micro-services and RESTful API development. Its primary advantage lies in its opinionated configuration, which eliminates the need for manual boilerplate...