I want to force all Oracle DATE columns to LocalDateTime.
What I tried:
<forcedType>
<name>LOCALDATETIME</name>
<userType>java.time.LocalDateTime</userType>
<types>DATE\(*\)</types>
</forcedType>
But jOOQ still generates LocalDate.
How must the forcedType look like?
Your <types> expression reads "DATE followed by any number of ( followed by exactly one ). You probably wanted this:
<types>DATE(\(.*\))?</types>
As a side note: You don't really need to specify the <userType> to profit from the "data type rewriting" feature. Specifying a name that matches a type from SQLDataType is enough.
Notice there was a bug in jOOQ 3.11 by which <name>LOCALDATETIME</name> did not work: https://github.com/jOOQ/jOOQ/issues/8493
This is fixed in jOOQ 3.12. For the time being, use <name>TIMESTAMP</name> instead, along with <javaTimeTypes>
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