MyBatis Articles
3 articles about MyBatis. Explore Spring Boot implementation, design, and operations across related topics.
-
How to Implement Pagination with Spring Boot + MyBatis - Choosing Between PageHelper, RowBounds, and Hand-Written LIMIT/OFFSET
Compares three approaches to paginating list APIs in Spring Boot + MyBatis (hand-written LIMIT/OFFSET, RowBounds, and PageHelper) in terms of generated SQL, count retrieval, sorting, and extra dependencies. Explains why RowBounds results in in-memory pagination, the thread-local pitfalls of PageHelper and its helperDialect setting, and how to convert to Spring Data's Pageable, all with ready-to-run code.
-
How to Use MyBatis with Spring Boot - An Implementation Guide to Mapper Definitions, Dynamic SQL, and Result Mapping
An implementation guide to integrating MyBatis into Spring Boot from scratch. It covers everything from adding the mybatis-spring-boot-starter dependency, defining Mappers using both annotation and XML notations, dynamic SQL with the if and foreach tags, mapping join results with resultMap, the safety of #{} vs ${}, and @Transactional integration—all explained with working code.
-
MyBatis vs JPA in Spring Boot - Selection Criteria and Combined Usage Patterns [With Comparison Table]
Wondering whether to choose MyBatis or JPA for your Spring Boot project? This article organizes SQL control flexibility, learning cost, performance, and maintainability in a comparison table, and explains practical decision flowcharts, the difference between #{} and ${}, and concrete configuration examples for using both together. Get all the decision criteria in one place.