Hi Anthony, This topic is the very reason that has kept us from going forward with an out-of-the-box JSR 310 integration. We have a different situation though - we'd like to (finally) add support for the SQL TIMESTAMP WITH TIME ZONE data type, which doesn't have any equivalent JDBC data type (apart from the horrible Timestamp + Calendar workaround). So, we'd love to use OffsetDateTime instead. Unfortunately, we then run into the same issues as you. Because of Java's generic type erasure and lack of support for union types, we cannot overload the existing date time arithmetic API. So we're stuck.
The easiest workaround for you might be to create a new DateTimeDSL and implement all methods from the jOOQ DSL again in there. Other than that, I currently don't see any solution, let alone an elegant one. Hope this helps. Lukas 2016-05-09 20:41 GMT+02:00 Anthony Calce <[email protected]>: > For the server time problem, I have created a wrapper function for now(): > return DSL.field("NOW()", DateTime.class); > return DSL.field("NOW() + INTERVAL " + value + " " + keyword, DateTime. > class); > > This is a trivial fix, but not being able to use date functions is still a > problem. I could create my own wrapper for each one which would work. I > was wondering if there was a more elegant solution. > > > > On Monday, 9 May 2016 13:56:27 UTC-4, Anthony Calce wrote: >> >> Hello, >> >> I currently have an a forced type conversion of Timestamp to joda >> DateTime. As a result, I am suffering from the following issues >> >> - cannot use any DSL function relating to dates (ie extract, date) >> since DateTime does not extend java.util.Date >> - Similar to above, I have no way to grab a current timestamp as seen >> from my MYSQL. We have resorted to using *new DateTime() *-- which >> returns current system time, which isn't quite correct (this breaks if >> servers have a bad time ref, or different timezones. >> >> I want my developers to use DateTime in our backend server instead of >> Timestamps. Can anyone offer a recommendation on how to proceed? >> > -- > You received this message because you are subscribed to the Google Groups > "jOOQ User Group" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
