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...
Dynamic SQL with Conditional Logic Dynamic SQL in MyBatis enables flexible query construction based on runtime conditions. Unlike raw JDBC where manual string concatenation leads to errors like missing spaces or trailing commas, MyBatis provides built-in tags for clean, maintainable code. Key tags i...
Two Development Approaches in MyBatis When working with MyBatis in production environments, developers typically choose between two approaches: Traditional DAO Implementation This approach requires manually writing DAO interface implementations with explicit SQL session management. The main drawback...
Spring Boot is a development framework built on top of the Spring Framework. It simplifies configuration by embedding servers like Tomcat and provides powerful auto-configuration based on project dependencies. This framework offers out-of-the-box features and plugins such as Spring Data and Spring S...
Lombok streamlines Java development by generating boilerplate code at compile time through annotations. To integrate it, add the following dependency: <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <scope>provided</scope> &...
Creating a Maven Project Start by creating a standard Maven Java project. Update pom.xml with the following dependencies: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-...
Case 1: Using MyBatis Alone Create a new configuration file mybatis-solo.xml in the resources directory with the fololwing content: <?xml version="1.0" encoding="utf-8"?> <configuration> <settings> <setting name="logImpl" value="LOG4J2"/&g...
@GetMapping("/page") @ApiOperation("Employee Pagination Query") public Result<PageResult> listByPage(StaffQueryDTO queryParams) { log.info("Executing employee pagination query with params: {}", queryParams); PageResult paginationResult = staffService.getPagedList(...
Core ORM Concepts Object-Relational Mapping (ORM) is a porgramming technique that converts data between incompatible type systems—specifically between object-oriented programming languages and relational databases. Instead of working with raw SQL queries, developers interact with objects that repres...