Missing @NotBlank in Bean Validation. How to emulate?
bean-validation, java
Solution
Hibernate Validator's `@NotBlank` is a composed constraint annotated with `@NotNull`. Additionally it has a constraint validator which checks that the trimmed length of the validated value is > 0.
Problem
I'm migrating an application built with the reference Hibernate implementation of Bean Validation. In this code there is usage of annotation `@NotBlank` (`org.hibernate.validator.constraints.NotBlank`). However, in my new Websphere 8 container there is a Bean Validation implementation bundled which I want to use. However, `@NotBlank` does not seem to be part in the Bean Validation API. Any suggestions on how to emulate the tag with correct Bean Validation annotations? I guess something starting with: `@NotNull@Size(min=1)`