BeanValidationEventListener is validating all properties although partial updates are enabled via bytecode enhancement

Description

Enabling dirty tracking by using the Bytecode Enhancement Maven plugin in combination with annotations @DynamicUpdate and @SelectBeforeUpdate attached to the corresponding entities ensure that partial updates are possible with Hibernate. But as soon as a javax.validation.spi.ValidationProvider like org.hibernate.validator.HibernateValidator is registered, the BeanValidationEventListener is validating all properties of the entity, even those that haven't been updated. So in fact, the partial update succeeds but the validation fails, if the developer doesn't set the mandatory fields annotated with @NotNull explicitly, although their annotation property @Column.updatable is set to false.

To fix this issue, I'm already preparing a pull request. As soon as this is done, I'll add a corresponding comment to reference it.

Environment

Java JDK8
Java Persistence API 2.1 (1.0.2.Final)
Hibernate ORM (5.2.7.Final)
Hibernate Validator (6.0.13.Final)
Hibernate Enhance Maven Plugin (5.2.7.Final)

Status

Assignee

Unassigned

Reporter

Daniel Müller

Fix versions

None

backPortable

None

Suitable for new contributors

Yes, likely

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major
Configure