Good point. It's a regular expression. I suspect the manual is wrong here... Nice catch!
I've created an issue for this: https://github.com/jOOQ/jOOQ/issues/4840 2015-12-22 16:29 GMT+01:00 Ben Hood <0x6e6...@gmail.com>: > Just following up on the pattern matching for the forced type on > TIMESTAMP(6), after stepping through getConfiguredForcedType(..) I > found that it was better to escape the parenthesis in the code > generator configuration: <types>TIMESTAMP\(6\)</types> > > Is this something that is required generally? > > On Tue, Dec 22, 2015 at 2:55 PM, Ben Hood <0x6e6...@gmail.com> wrote: > > Hi Lukas, > > > > Thanks for the heads up. I can appreciate that the subject of date > > handling is very tricky to get right at a generic library level to > > suit all use cases. I'm struggling enough with dates in just one app, > > let alone any arbitrary app :-) > > > > I've already run into the issue of the timezone of the JVM app - > > previously I had a JOOQ Timestamp <-> ZonedDateTime Converter, but > > discovered that the resultant Timestamp was in the JVM timezone, i.e. > > the conversion was lossy and dependent on the JVM setting. I'd prefer > > the code base to be independent of the JVM time zone, since relying on > > a bug-free JVM setting is asking for trouble IMHO. > > > > So TIMESTAMPZ is the way to go - what is the advantage of this type? > > > > BTW I think I'm still struggling with the match specification for the > > forced type in the code generator. Previously I started a thread about > > this with regard to NUMBER(19) and how to debug this, which I have > > deferred up until now, but now I think I'll have to bite the bullet. I > > think that forced type handling code is an util class that is not > > ordinarily on the project classpath (because it is compiler-related > > code?). > > > > Cheers, > > > > Ben > > > > > > On Tue, Dec 22, 2015 at 2:26 PM, Lukas Eder <lukas.e...@gmail.com> > wrote: > >> Hi Ben, > >> > >> This, unfortunately, is not yet covered in the jOOQ docs. We wanted to > >> publish full JSR-310 support with jOOQ 3.7, but we ran into several > issues > >> that prevented full support. It's rather straightforward to do at the > user > >> side, though. You should implement a data type Binding: > >> > http://www.jooq.org/doc/latest/manual/code-generation/custom-data-type-bindings/ > >> > >> ... and bind your java.time.Instant type to oracle.sql.TIMESTAMPTZ. As > far > >> as I'm aware, the ojdbc driver does not yet support any java.time Types > as > >> specified by JDBC 4.2 > >> > >> You shouldn't use java.sql.Timestamp, if possible, unless you can > guarantee > >> that the JVM and the Oracle server are both running in UTC. > >> java.sql.Timestamp corresponds to SQL's TIMESTAMP WITHOUT TIME ZONE, or > >> JSR-310's LocalDateTime... > >> > >> Hope this helps, > >> Let me know if you have any further questions, > >> Lukas > >> > >> 2015-12-22 13:51 GMT+01:00 Ben Hood <0x6e6...@gmail.com>: > >>> > >>> Hi Lukas, > >>> > >>> I'd like to store all timestamps in Oracle in UTC but the app that > >>> receives data from a client should accept timestamps with an offset. > >>> > >>> What would be the most appropriate pipeline with JOOQ to ensure that > >>> only UTC is being used internally: > >>> > >>> Client -> "2013-06-14T06:32:33.830+05:00" -> ZonedDateTime z; -> > >>> Timestamp.from(z.toInstant()) -> JOOQ DSL -> Database > >>> > >>> ? > >>> > >>> Or is it better to remap the Oracle TIMESTAMP type to a different type > >>> for the generated code, such as Instant or LocalDateTime? > >>> > >>> Are there any examples in the documentation where this is covered? > >>> > >>> Cheers, > >>> > >>> Ben > >>> > >>> -- > >>> 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 jooq-user+unsubscr...@googlegroups.com. > >>> 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 jooq-user+unsubscr...@googlegroups.com. > >> 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 jooq-user+unsubscr...@googlegroups.com. > 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 jooq-user+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.