Do you suppose you could give me a rundown of whats going on internally for these objects on inserts? I would much rather be using Records than these custom insert statements with casts. I keep running into problems out of jOOQ, NullPointerExceptions (no idea) and other things.
If I may say, what we really need is a proper "ANY" type that can be used with records, basically any time jOOQ runs into "USER-DEFINED" just use the magic ANY type and ignore all the type BS Java side as the user is clearly trying to do something crazy. There are already several checks for UDT, cursor type, and such in the type system, but the current Postgres ANY type is of type Object (SQL type OTHER) and then jOOQ insists incorrectly somewhere, instead of just passing it through to the JDBC engine. On Monday, February 25, 2013 7:38:26 AM UTC-5, Lukas Eder wrote: > > Hi Peter, > > Thanks a lot for showing these hacks. Clearly, this isn't how jOOQ > should be used in the long run ;-) > > But it helps understanding what parts of the code generator and the > core will need to be adapted to finally support these PG* types. It > looks like using the String serialisation of these types, with the > appropriate cast, is a good way to handle such bind values. > > For now, PG* types can probably be identified through reflection, in > order to avoid creating compile-time dependencies within jOOQ's core > module. In a future version, I might think about adding new modules > for vendor-specific feature support, exposing PG* type converters, > converting <String, PG*> > > I will increase the priority of #982, as formal support for these > Postgres extensions have now been requested many times on the user > group: > https://github.com/jOOQ/jOOQ/issues/982 > > I think that jOOQ 3.1 will certainly be a good milestone to implement > these things. Feel free to post any other findings that you may have > in the mean time. > > Cheers > Lukas > > 2013/2/25 Peter Cooner <[email protected] <javascript:>>: > > Here we go, hacks abound. > > > > DataType<Object> geometry = new DefaultDataType<>( > > SQLDialect.POSTGRES, SQLDataType.OTHER, "geometry"); > > f.insertInto(TRACK_POSITION, TRACK_POSITION.GEOM_POS) > > .values(cast(PGgeomPoint.toString(), geometry)) > > .execute(); > > > > - Executing query : insert into "public"."track_position" > > ("geom_pos") values (cast(? as geometry)) > > - -> with bind values : insert into "public"."track_position" > > ("geom_pos") values (cast('SRID=4326;POINT(0 0)' as geometry)) > > > > This is what I end up doing to insert PostGIS points until PGobjects can > be > > inserted again. > > > > > > -- > > Pete > > > > -- > > 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] <javascript:>. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- 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/groups/opt_out.
