Skip to main content

Spring

MyBatis with Spring Boot 4: Mappers, Dynamic SQL and Pagination

A first-meeting guide to MyBatis on Spring Boot 4.2: annotation and XML mappers, result maps (JOIN vs N+1), dynamic SQL, #{} vs ${}, PageHelper and its ThreadLocal trap, and @MybatisTest. Every SQL statement quoted was printed by a real run of the companion module.

Human-in-the-Loop Tool Calls in Spring AI 2.1: Tool Call Confirmation and Approvals

Spring AI 2.1 can pause the tool-calling loop before a marked tool runs, so a person approves or denies the call. This post builds the whole flow on a flight-booking service: marking tools, detecting the pause, resuming with decisions, confirmation policies, and the parts the framework leaves to you (approver check, replay guard, audit log, an SSE and htmx approver page). Every figure comes from a test in the companion module, run with a scripted model.

JWT Refresh Token Rotation in Spring Security 7 (With Reuse Detection)

Build refresh token rotation with token families and reuse detection on Spring Boot 4.1 and Spring Security 7.1. Opaque hashed tokens, a race-proof conditional UPDATE, a grace window, logout everywhere, and the access token that outlives logout, all run and captured.