-
Bug
-
Resolution: Done
-
Major
-
7.4.3.CR1
Customer is migrating from EAP 7.1 to EAP 7.4 and they hit an issue regarding conversion of java.sql.Date to TemporalType.DATE.
They have a column
@Column(nullable = false) @NotNull @Past @Temporal(TemporalType.DATE) public Date getDob() { return dob; }
This results in
Caused by: java.lang.UnsupportedOperationException at java.sql/java.sql.Date.toInstant(Date.java:316) at org.hibernate.validator@6.0.22.Final-redhat-00002//org.hibernate.validator.internal.constraintvalidators.bv.time.past.PastValidatorForDate.getInstant(PastValidatorForDate.java:23) at org.hibernate.validator@6.0.22.Final-redhat-00002//org.hibernate.validator.internal.constraintvalidators.bv.time.past.PastValidatorForDate.getInstant(PastValidatorForDate.java:19) at org.hibernate.validator@6.0.22.Final-redhat-00002//org.hibernate.validator.internal.constraintvalidators.bv.time.AbstractInstantBasedTimeValidator.isValid(AbstractInstantBasedTimeValidator.java:55) at org.hibernate.validator@6.0.22.Final-redhat-00002//org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateSingleConstraint(ConstraintTree.java:171)
exception if they try to do merge. (I've attached their test case). I modified their test case and change table definition from DATE to TIMESTAMP the the column definition to @Temporal(TemporalType.TIMESTAMP) and that seem to fixed the issue. But customer says this is unacceptable to them. They claim that it used to work in EAP 7.1.
I have reproduced the issue in EAP 7.4.2 but reading the java.sql.DATE I'm surprised that it ever worked since the docs imply that java.sql.DATE works that way. Am I missing something? Is there a work around it?
- is incorporated by
-
JBEAP-23194 Upgrade hibernate-validator from 6.0.22.Final-redhat-00002 to 6.0.23-redhat-00001
- Closed