Hi Leigh, Thank you very much for your enquiry. Would you mind posting an example of:
- Such a PostgreSQL UDT - A table that uses it as an array - Your Binding implementation - Your code generator setup Normally, you should not pass through the DefaultBinding for this case, but bind your variable yourself. The very reason why you're using your own binding. So, I'd like to see if there's a bug that prevents your binding from being applied, or just bad code generator setup. Thanks Lukas 2016-07-01 6:43 GMT+02:00 <[email protected]>: > Hi there! > Perhaps an unusual case but one I ran into today: > > If I have a Postgres UDT ('MyUdt') that contains a field mapped with a > custom JOOQ binding (like a hstore or json field as mentioned here: > http://www.jooq.org/doc/3.8/manual/code-generation/custom-data-type-bindings/) > and that UDT is used to form an array field ('MyUdt[]') on another table, > then JOOQ fails to generate the correct SQL to insert into that array of > UDTs. > > The code being triggered when binding the provided value to the SQL > statement is in DefaultBinding.java:1108: > > else if (actualType.isArray()) { > switch (dialect.family()) { > case POSTGRES: { > ctx.statement().setString(ctx.index(), toPGArrayString((Object[]) > value)); > break; > } > > > The calls below toPGArrayString assume the object and it's fields are > either JOOQ records or basic types that can be mapped with toString(). At > this point, the fact that a field on the object in the array has a custom > binding is not considered. > > Using: Postgres 9.5.3, Jooq 3.8.1 > > Since this is quite likely a corner case experienced by only a few I'm not > anticipating a fix soon - I'm planning to rework my schema and continue on > for now (rather than even make a patch). > > Thanks for any input, > > Leigh > > -- > 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. > -- 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.
