您的位置:首页 > 编程语言 > Java开发

HV000030: No validator could be found for type: java.lang.Integer

2017-01-04 12:02 736 查看
HV000030: No validator could be found for type: java.lang.Integer

That will happen when you use JSR303 bean validation in flavor of Hibernate Validator and you have in your JPA entity the Hibernate-specific 
@NotEmpty
 on
an 
Integer
 property
like this:
@NotEmpty
private Integer some;


This is completely wrong. An integer cannot be considered as a string,
collection, map or array. Use the standard 
@NotNull
 instead.
@NotNull
private Integer some;


Please note that the concrete problem is completely unrelated to JSF. In the future, please learn how to exclude as much as possible noise and naildown the concrete problem by e.g. executing the JPA code individually. JSF is merely the HTTP/MVC messenger here
and PrimeFaces is merely the HTML/CSS/jQuery/UI code generator.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐