MyBatis Source Code Analysis: Mapper Proxy Mechanism
In earlier versions of MyBatis, developers could invoke database operations directly through the DefaultSqlSession's selectOne() method using the StatementID defined in Mapper XML files. This approach, while functional, presented significant maintainability challenges. The StatementID was specified as a hardcoded string constant, making refacto ...
Posted on Mon, 18 May 2026 18:03:21 +0000 by bidnshop
MyBatis Return Types: Handling List, Map, and Fuzzy Queries
Returning List Results
When querying multiple records, MyBatis can automatically map results to a Java List. The mapper XML uses the same select element, but the Java method declares List as the return type.
Mapper Interface:
public interface StudentDao {
List<Student> selectAllStudents();
}
Mapper XML:
<select id="selectAllS ...
Posted on Sat, 09 May 2026 22:54:07 +0000 by ChaosKnight