Implementing Soft Delete with MyBatis Interceptor
@Intercepts({
@Signature(type = StatementHandler.class, method = "prepare", args = {Connection.class, Integer.class})
})
@Component
public class SoftDeleteInterceptor implements Interceptor {
@Override
public Object intercept(Invocation invocation) throws Throwable {
StatementHandler handler = (StatementHandler) in ...
Posted on Fri, 19 Jun 2026 16:59:07 +0000 by vornn
Academic Achievement Management System Design and Implementation with Java, SSM, and JSP
This system is built using the SSM (Spring, Spring MVC, MyBatis) framework for the backend, JSP for the frontend, and MySQL as the database.
Core Technology Stack
Backend: Spring Framework
Spring provides comprehensive infrastructure support for Java development, handling dependency injection and aspect-oriented programming. Spring MVC serves a ...
Posted on Fri, 19 Jun 2026 16:57:04 +0000 by thefarhan
Developing a Food Snatching and Sharing Platform for WeChat Mini Program Users
Given the widespread adoption of WeChat, the client side of this platform is developed as a WeChat Mini Program to align with real-world usage scenarios.
1. Implementing WeChat Login (Controller Layer)
@PostMapping("/wechat-login")
@ApiOperation("WeChat user authentication")
public Result<AuthResponseVO> authenticate(@ ...
Posted on Mon, 15 Jun 2026 16:51:24 +0000 by skter4938
Understanding Transaction Commit Behaviors in MyBatis and MySQL Storage Engines
Impact of Storage Engines on Transaction Handling
In MyBatis development, developers often assume that every data modification requires an explicit sqlSession.commit() call to persist changes to the database. While this holds true for most production scenarios, the actual persistence behavior depends heavily on the underlying storage engine, sy ...
Posted on Sun, 14 Jun 2026 17:40:25 +0000 by intenseone345
Leveraging MyBatis Where and Trim Tags for Robust Dynamic Query Construction
When building dynamic conditional queries in MyBatis, manual WHERE clause construction can introduce syntax errors from leading AND/OR operators or a dagnling WHERE keyword when no filters apply. For example, this flawed query snippet demonstrates both issues:
<select id="fetchBlogEntry" resultType="BlogEntity">
SELE ...
Posted on Fri, 12 Jun 2026 16:51:00 +0000 by Mike521
Spring Framework: Annotation-Based Development, Third-Party Bean Management, and Integration with MyBatis and JUnit
Managing Third-Party Beans with IoC/DI Configuration
=======================================================
This section demonstrates how to manage third-party beans using Spring's Inversion of Control (IoC) container. We'll use DruidDataSource and ComboPooledDataSource as examples.
1.1 Managing a Data Source Object
1.1.1 Environment Setup
...
Posted on Wed, 10 Jun 2026 17:28:27 +0000 by trellie
MyBatis Interface Proxy and Advanced Features
Interface Proxy Implementation
Proxy Development Approach
MyBatis enables DAO layer creation through interface proxies. The framework dynamical generates proxy objects implementing mapper interfaces, eliminating manual DAO implementations.
Development Requirements:
XML mapper namespace must match the interface's fully qualified name
Method nam ...
Posted on Wed, 10 Jun 2026 17:15:56 +0000 by faraco
Understanding MyBatis Mapper Dynamic Proxy Implementation
SQL Execution Flow Recap
Standard MyBatis execution involves explicit DAO implementation classes handling SQL execution. The typical flow requires:
Defining a DAO interface
Implementing the interface with explicit SQL execution logic
Manually mapping method names to SQL statement IDs
This manual mapping creates unnecessary boilerplate code. T ...
Posted on Tue, 09 Jun 2026 17:27:05 +0000 by system
MyBatis SQL Execution Pipeline: From SqlSession to Executor with Caching and Interceptor Support
MyBatis operates as a semi-automated ORM framework, decoupling SQL from Java code via XML or annotations. Its SQL execution follows a delegation chain: SqlSession.getMapper() produces a proxy, MapperProxy intercepts calls, MapperMethod translates them, and Executor handles database interaction, caching, and plugins.
This article dissects the ca ...
Posted on Sun, 07 Jun 2026 17:12:20 +0000 by rmbarnes82
Spring Boot with MyBatis Transaction Management Setup
Maven Dependencies
Add the following dependencies to you're pom.xml:
<!-- MyBatis integration for Spring Boot -->
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
<version>1.3.1</version>
</dependency>
<!-- MySQL ...
Posted on Sun, 07 Jun 2026 16:41:13 +0000 by frost