I have a JAXB generated class containing the following:
@Pattern(regexp = "[0-9]", message = "Message details here")
protected Short msgVal;
When I run a JUnit test to validate an instance of that class via Hibernate, I get:
javax.validation.UnexpectedTypeException: No validator could be found for type: java.lang.Short
.
If I comment out the @Pattern
constraint, the JUnitTest runs fine.
Is it possible to have @Pattern
constraints on Short values? If so, what am I missing?
Regards, PM.