Re: Clarifications on custom generated custom domain Types - jooq ep

36 views
Skip to first unread message

Lukas Eder

unread,
Dec 20, 2023, 3:46:29 AM12/20/23
to jooq...@googlegroups.com
Hi Francesco,

This might be a domain related bug. Can you please provide a complete reproducer here?

Thanks,
Lukas

On Wed, Dec 20, 2023 at 9:27 AM Francesco Buda <franc...@gmail.com> wrote:
I have a java web application with Postgresql as its underlying database, on which I have defined a custom Domain "customtype" as "tstzrange".

I've added a dependency to:

<dependency>
        <groupId>org.jooq.pro</groupId>
        <artifactId>jooq-postgres-extensions</artifactId>
        <version>3.18.7</version>
    </dependency>

and my code generator looks like:
<generator>
<database>
<name>org.jooq.meta.postgres.PostgresDatabase</name>
<includes>.*</includes>
<excludes></excludes>
<inputSchema>myschema</inputSchema>
</database>
<target>
<packageName>mypackage.jooq.generated</packageName>
<directory>src/main/java</directory>
</target>
</generator>

Code generation seems to work correctly in fact on the log I read:
myschema.customtype to <priority>-2147483648</priority><userType>org.jooq.postgres.extensions.types.OffsetDateTimeRange</userType><binding>org.jooq.postgres.extensions.bindings.OffsetDateTimeRangeBinding</binding><includeTypes>tstzrange</includeTypes><nullability>ALL</nullability><objectType>ALL</objectType>

and I have the java Domain:
    public static final Domain<OffsetDateTimeRange> CUSTOMTYPE = Internal.createDomain(
          schema()
        , DSL.name("timeperiod")
        , org.jooq.impl.DefaultDataType.getDefaultDataType("\"myschema\".\"tstzrange\"")   
        , new OffsetDateTimeRangeBinding()
    );


It's not clear to me if I have to configure something else to have OffsetDateTimeRange  when querying on columns which uses my customtype as dataType, or if it's even possible.
For instance a query like "Result<org.jooq.Record> r = dsl.fetch("select * from mytable");", in which column1 is of type "customtype",  it shows Pgobject as column1's data type.

Thanks in advance,
Francesco

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/8a6bae58-14f0-469e-80fb-01a0cd416aa3n%40googlegroups.com.

Francesco Buda

unread,
Dec 20, 2023, 4:56:34 AM12/20/23
to jOOQ User Group
Hi Lukas,
here's the issue link:
https://github.com/jOOQ/jOOQ/issues/15969

Thanks,
Francesco
Reply all
Reply to author
Forward
0 new messages