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+unsubscr...@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.

Reply via email to