I have hibernate mapping as follow:
<property formula="(Timediff(ifnull(sttime,now()),sstime))" insert="false" name="duration" update="false" />
where sstime is of type Timestamp
here this formula returns some value in this format "838:59:59" from my data.
I got the exception when i am trying to load this value in 'Duration' field, which has 'java.sql.Time' type, it gives me this exception.
"Generic JDBC exception - Bad format for Time '838:59:59'"
That's indeed not a valid time. You should not use a java.sql.Time to represent a duration, especially if this duration is potential longer tha 24 hours, since a Time represents the time portion of a date. Use a custom type instead, or simply a string that you'll parse yourself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With