"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
enum
property 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
enum
entity 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, tools, and much more.