Hibernate Validator Articles
2 articles about Hibernate Validator. Explore Spring Boot implementation, design, and operations across related topics.
-
How to Control Validation Execution Order with @GroupSequence in Spring Boot - Redefining the Default Group and @GroupSequenceProvider
A guide to ordering group validation in Spring Boot 3.x so that heavy constraints such as DB existence checks run only after format checks pass. Covers the pitfalls of redefining the Default group with @GroupSequence on DTO classes (HV000053/HV000054), implementing Hibernate Validator's @GroupSequenceProvider to switch groups based on object state, staged error responses in a REST API, and MockMvc tests that guarantee later-stage constraints are never invoked, all with working code.
-
Spring Boot Validation Annotations Cheat Sheet - From the Differences Between @NotNull/@NotEmpty/@NotBlank to Custom Messages
A cheat sheet of the standard constraint annotations available in Spring Boot 3.x (Jakarta Bean Validation 3.0), listing each one's target types, behavior on null, and default message. Covers the differences between @NotNull/@NotEmpty/@NotBlank, @Size vs @Length, choosing between numeric, date-time, and string constraints, Hibernate Validator-specific constraints, and overriding messages with localized text via ValidationMessages.properties or messages.properties.