"HV000030: No validator could be found for type" for string mapped enumeration in Hibernate
Issue
javax.validation.UnexpectedTypeException: HV000030: No validator could be found for type my.types.Day.
- An entity has an
enumproperty which is mapped with@Enumerated(EnumType.STRING)
public enum Day {
SUNDAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY
}
import javax.persistence.Enumerated;
import javax.persistence.EnumType;
@Entity
public class Week ... {
@Enumerated(EnumType.STRING)
...
private Day day;
}
- Using JSR 303 bean validation constraints with the
enumentity property- Using
@Length - Using a custom implementation of
javax.validation.ConstraintValidator
- Using
Environment
- Red Hat JBoss Enterprise Application Platform (EAP) 6
- Hibernate 4
- JSR 303 Bean Validation 1.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
