Thursday, 27 December 2018

javax.validation.ConstraintViolationException

javax.validation.ConstraintViolationException: Validation failed for classes [com.yardbud.entities.LoginInfo] during persist time for groups [javax.validation.groups.Default, ]
List of constraint violations:[
ConstraintViolationImpl{interpolatedMessage='may not be null', propertyPath=loginInfo.email, rootBeanClass=class com.yardbud.entities.Lister, messageTemplate='{javax.validation.constraints.NotNull.message}'}
ConstraintViolationImpl{interpolatedMessage='may not be null', propertyPath=loginInfo.password, rootBeanClass=class com.yardbud.entities.Lister, messageTemplate='{javax.validation.constraints.NotNull.message}'}
]

This is due to entity field value is validated before it is persisted. So checking the input values into the data model. 


@Embedded@Validprotected LoginInfo loginInfo;

@NotNull@Column(name = "PASS_WORD")
protected String password;

No comments:

Can Jackson Deserialize Java Time ZonedDateTime

Yes, but must include JSR310. Thus ZonedDateTime can be deserialized directly from JSON response to POJO field. <dependency> <g...