Dynamic SQL Articles
2 articles about Dynamic SQL. Explore Spring Boot implementation, design, and operations across related topics.
-
Dynamic SQL in Spring Boot + MyBatis: How to Write where, set, trim, choose, bind, and foreach, and How to Fix "Leading AND Left Behind", "Trailing Comma", and "Empty IN Clause Crashes"
A walkthrough of Spring Boot + MyBatis dynamic SQL tags (where/set/trim/choose/bind/foreach), showing the XML you write side by side with the SQL actually issued. Covers a search Mapper that doesn't break even when every condition is empty, partial updates that never leave a trailing comma, and defensive patterns so foreach doesn't fail when given an empty list or null, organized as fixes by error type.
-
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.