Failure to use forcedTypes on sqlserver vs postgres

25 views
Skip to first unread message

Daniel Einspanjer

unread,
Dec 23, 2016, 7:40:46 AM12/23/16
to jOOQ User Group
I'm using jooq 3.8.6 and I have one schema I'm importing from a Postgres DB, and I am forcing use of the java.time with the following <database/> block:
<forcedTypes>
<forcedType>
<name>LOCALDATE</name>
<types>^DATE$</types>
</forcedType>
<forcedType>
<name>LOCALTIME</name>
<types>^TIME$</types>
</forcedType>
<forcedType>
<name>LOCALDATETIME</name>
<types>^TIMESTAMP$</types>
</forcedType>
</forcedTypes>


This works fine so far.  However, I am also trying to import another schema from a MS Sql Server 2012 instance.  I downloaded and installed the jooq trial in my maven tree and I'm trying to use the same basic mappings with the T-SQL data types:
<forcedTypes>
<forcedType>
<name>LOCALDATE</name>
<types>^DATE$</types>
</forcedType>
<forcedType>
<name>LOCALTIME</name>
<types>^TIME$</types>
</forcedType>
<forcedType>
<name>LOCALDATETIME</name>
<types>^(SMALL)?DATETIME2?$</types>
</forcedType>
<forcedType>
<name>OFFSETDATETIME</name>
<types>^DATETIMEOFFSET$</types>
</forcedType>
</forcedTypes>

but this gives the following error:
[INFO] Forcing type             : mydb.dbo.mytable.ADateTimeField with type datetime into LOCALDATETIME
[WARNING] Bad configuration for <forcedType/> LOCALDATETIME. No matching <customType/> found, and no matching SQLDataType found: <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<forcedType xmlns:ns2="http://www.jooq.org/xsd/jooq-codegen-3.8.0.xsd">
    <ns2:name>LOCALDATETIME</ns2:name>
    <ns2:types>^(SMALL)?DATETIME2?$</ns2:types>
</forcedType>

I checked the SQLDataType class found in the trial package, and it does include LOCALDATETIME and family same as the OSS version.  That warning appears for all four of the types I'm trying to force.

What could I be doing wrong here?

-Daniel

Daniel Einspanjer

unread,
Dec 23, 2016, 10:03:05 AM12/23/16
to jOOQ User Group
Okay, I take it back.  I know I had the postgres case working at one point, but now I'm getting the same error on my postgres generate.  I'm suspecting I've introduced some sort of maven dependency misconfiguration. :/

-Daniel

Daniel Einspanjer

unread,
Dec 23, 2016, 1:34:48 PM12/23/16
to jOOQ User Group
Rather than continue troubleshooting this, I'm just trying out the support in 3.9.0 instead. :)

Lukas Eder

unread,
Jan 3, 2017, 11:28:50 AM1/3/17
to jooq...@googlegroups.com
Hi Daniel,

I'm sorry for the delay in this. Have you succeeded in working this out with version 3.9 instead?

Cheers,
Lukas

2016-12-23 19:34 GMT+01:00 Daniel Einspanjer <daniel.e...@designet.com>:
Rather than continue troubleshooting this, I'm just trying out the support in 3.9.0 instead. :)

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Einspanjer

unread,
Jan 3, 2017, 4:59:06 PM1/3/17
to jOOQ User Group
Yes, I have made great progress using various types of matching strategies in 3.9.  The only issue I've hit that has been any bother is the lack of mapping for TIMESTAMP WITH TIMEZONE ( https://github.com/jOOQ/jOOQ/issues/5734 ).

Thank you very much for following up.

-Daniel

Lukas Eder

unread,
Jan 4, 2017, 2:40:46 AM1/4/17
to jooq...@googlegroups.com
Thanks for the feedback, that's great to hear! I'll increase the priority of that issue #5734

--
Reply all
Reply to author
Forward
0 new messages