Hi Clément

H2 doesn't have a NUMBER data type. While it recognises the NUMBER syntax
for compatibility reasons, internally, the type is called DECIMAL. You can
try this:

create table t (n number(1,0));
select type_name
from information_schema.columns
where table_name = 'T';


You will get:

TYPE_NAME|
---------|
DECIMAL  |


Note, we could have used information_schema.columns.column_type, which
still refers to the original NUMBER(1, 0) type description, but I've never
found column_type to be a very reliable source.

One way to solve this is by specifying:

  <types>(NUMBER|DECIMAL)\(1,\s*0\)</types>

I hope this helps,
Lukas

On Mon, Sep 14, 2020 at 4:19 PM Clément Allain <[email protected]> wrote:

>
> Hello,
>
> I want to take advantage of generating jOOQ code using LiquibaseDatabase
> and an H2 in memory database.
>
> I manage to make all our liquibase changesets pass with H2. They were
> generated with an Oracle Database. Had some issues but it's ok now :)
>
> But the type rewriting we used doesn't work anymore.
>
> This was the original configuration.
> <forcedTypes>
> <forcedType>
> <userType>java.lang.Boolean</userType>
> <converter>com.packages.ByteToBooleanConverter</converter>
> <name>BOOLEAN</name>
> <expression>.*</expression>
> <types>NUMBER\(1,\s*0\)</types>
> </forcedType>
> </forcedTypes>
>
> Basically we were converting NUMBER(1, 0) to java Boolean.
> So now I got Byte instead of Boolean, I tried a lot of different
> configurations without success.
>
> Do you have any clue ?
>
> --
> 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].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jooq-user/bd8cb99c-a522-4d43-97ea-6214272a4cd6n%40googlegroups.com
> <https://groups.google.com/d/msgid/jooq-user/bd8cb99c-a522-4d43-97ea-6214272a4cd6n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/CAB4ELO62gcf7R3zayLfmzgjEeN9rtn2G21Z71%3D4JH8V1COToDA%40mail.gmail.com.

Reply via email to