早教吧 育儿知识 作业答案 考试题库 百科 知识分享

请问这个错误怎么解决,javax.validation.ConstraintViolationException:Validationfailedforclasses[com.wyb.entity.site.SiteContent]duringpersisttimeforgroups[javax.validation.groups.Default,]Listofconstraintviolations:[\x05Constrain

题目详情
请问这个错误怎么解决,
javax.validation.ConstraintViolationException:Validation failed for classes [com.wyb.entity.site.SiteContent] during persist time for groups [javax.validation.groups.Default,]
List of constraint violations:[
\x05ConstraintViolationImpl{interpolatedMessage='不能为null',propertyPath=type,rootBeanClass=class com.wyb.entity.site.SiteContent,messageTemplate='{javax.validation.constraints.NotNull.message}'}
\x05ConstraintViolationImpl{interpolatedMessage='不能为空',propertyPath=title,rootBeanClass=class com.wyb.entity.site.SiteContent,messageTemplate='{org.hibernate.validator.constraints.NotBlank.message}'}
]
\x05at org.hibernate.cfg.beanvalidation.BeanValidationEventListener.validate(BeanValidationEventListener.java:159)
\x05at org.hibernate.cfg.beanvalidation.BeanValidationEventListener.onPreInsert(BeanValidationEventListener.java:94)
\x05at org.hibernate.action.internal.EntityIdentityInsertAction.preInsert(EntityIdentityInsertAction.java:178)
\x05at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:75)
\x05at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:393)
\x05at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:227)
\x05at org.hiberna
▼优质解答
答案和解析
使用了 JSR 303 参数验证.
对象实例的值不合格
单调一下 看看实例化之前的值是什么
应该是不符合验证要求了
看了 请问这个错误怎么解决,jav...的网友还看了以下: