Hi,
    I'm using a maven plugin to generate jooq classes. Time types are 
mapped on * java.time.*.
This configuration works right on SQLServer, but on postgres TIMESTAMP 
(with no timezone) is not mapped as expected, so that I've added 
the bold section to achieve this, but it doesn't work.
Any suggestions?



<plugin>
    <groupId>org.jooq.pro</groupId>
    <artifactId>jooq-codegen-maven</artifactId>
    <version>${org.jooq.pro.version}</version>
    <executions>
        <execution>
            <id>generate-jooq</id>
            <phase />
            <goals>
                <goal>generate</goal>
            </goals>
            <configuration>
                <jdbc>
                    <driver>${spring.datasource.driverClassName}</driver>
                    <url>${spring.datasource.url}</url>
                    <user>${spring.datasource.username}</user>
                    <password>${spring.datasource.password}</password>
                </jdbc>
                <generator>
                    <database>
                        <name>${jooq-database-name}</name>
                        <includes>.*</includes>
                        <excludes/>
                        <dateAsTimestamp>false</dateAsTimestamp>
                        <!-- <inputSchema>PUBLIC</inputSchema> -->
                        <inputSchema>${spring.datasource.schema}</inputSchema>
                        <customTypes>
                            <customType>
                                <name>LocalDateTime</name>
                                <type>java.time.LocalDateTime</type>
                                
<converter>${company-package-prefix}.jooq.converters.LocalDateTimeConverter</converter>
                            </customType>
                            <customType>
                                <name>LocalDate</name>
                                <type>java.time.LocalDate</type>
                                
<converter>${company-package-prefix}.jooq.converters.LocalDateConverter</converter>
                            </customType>
                            <customType>
                                <name>LocalTime</name>
                                <type>java.time.LocalTime</type>
                                
<converter>${company-package-prefix}.jooq.converters.LocalTimeConverter</converter>
                            </customType>
                            <customType>
                                <name>XmlSqlXmlBinding</name>
                                <type>java.sql.SQLXML</type>
                                
<binding>it.clesius.jooq.bindings.XmlSqlXmlBinding</binding>
                            </customType>
                            <customType>
                                <name>XmlStringBinding</name>
                                <type>java.lang.String</type>
                                
<binding>it.clesius.jooq.bindings.XmlStringBinding</binding>
                            </customType>
                        </customTypes>
                        <forcedTypes>
                            <forcedType>
                                <name>LocalDateTime</name>
                                
<expression>(\w+\.)?(?!UDT_PREFIX|PROC_PREFIX)\w+(\.\w+)?</expression>
                                <types>DATETIME</types>
                            </forcedType>
                            <forcedType>
                                <name>LocalTime</name>
                                
<expression>(\w+\.)?(?!UDT_PREFIX|PROC_PREFIX)\w+(\.\w+)?</expression>
                                <types>TIME</types>
                            </forcedType>
                            <forcedType>
                                <name>LocalDate</name>
                                
<expression>(\w+\.)?(?!UDT_PREFIX|PROC_PREFIX)\w+(\.\w+)?</expression>
                                <types>DATE</types>
                            </forcedType>*                            
<forcedType>
                                <name>LocalDateTime</name>
                                
<expression>(\w+\.)?(?!UDT_PREFIX|PROC_PREFIX)\w+(\.\w+)?</expression>
                                <types>TIMESTAMP</types>
                            </forcedType>*
                            <!--                                             
<forcedType> -->
                            <!--                                                
 <name>OffsetTime</name> -->
                            <!--                                                
 <expression>(\w+\.)?(?!UDT_PREFIX|PROC_PREFIX)\w+(\.\w+)?</expression> -->
                            <!--                                                
 <types>TIME_WITH_TIMEZONE</types> -->
                            <!--                                             
</forcedType> -->
                            <!--                                              
<forcedType> -->
                            <!--                                                
 <name>OffsetDateTime</name> -->
                            <!--                                                
 <expression>(\w+\.)?(?!UDT_PREFIX|PROC_PREFIX)\w+(\.\w+)?</expression> -->
                            <!--                                                
 <types>TIMESTAMP_WITH_TIMEZONE</types> -->
                            <!--                                             
</forcedType> -->
                            <forcedType>
                                <name>XmlStringBinding</name>
                                
<expression>(\w+\.)?(?!UDT_PREFIX|PROC_PREFIX)\w+(\.\w+)?</expression>
                                <types>XML</types>
                            </forcedType>
                        </forcedTypes>
                    </database>

                    <generate>
                        <deprecated>false</deprecated>
                        <instanceFields>true</instanceFields>
                        <pojos>true</pojos>
                        <validationAnnotations>true</validationAnnotations>
                        <fluentSetters>true</fluentSetters>
                    </generate>
                    <target>
                        <packageName>${jooq-packageName}</packageName>
                        <!-- 
<directory>target/generated-sources/jooq-sqlserver</directory> -->
                        <directory>src/main/generated</directory>
                    </target>
                </generator>
            </configuration>
        </execution>
    </executions>
    <dependencies>
        <!-- db here -->
        <!-- <dependency> -->
        <!-- <groupId>com.h2database</groupId> -->
        <!-- <artifactId>h2</artifactId> -->
        <!-- <version>${h2.version}</version> -->
        <!-- </dependency> -->
    </dependencies></plugin>

-- 
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.

Reply via email to