Hello Lukas,
> Unfortunately, jOOQ Routines (e.g. generated ones) currently don't
> support jOOQ Converters.
I am not sure if you understood well, maybe i didn't explain well.
In fact, i use jOOQ generated Routines for insert/update like that :
public Cart save(Cart cart) {
Integer cartId = Routines.cartAdd(create, cart.getLocalDateTimeParam(),
cart.getStringParam());
cart.setCartId(cartId);
return cart;
}
where Cart is a POJO generated by Jooq, which contains joda types thanks to
Jooq Converters.
I did a test, and it seems to work well.
> In principle, this works for JodaTime as well. However, it doesn't
> work automatically for record to POJO mapping. I think you've
> discovered an important missing feature here. I've registered #2029
> for this:
> https://github.com/jOOQ/jOOQ/issues/2029
Great ! I will try to send you a pull request for this if needed.
I would also like to thank you for the great work done on this framework,
as it's becoming
less and less boring and hard to work with Stored procedures thanks to it.
Thanks a lot.
Eric.
On Thursday, December 20, 2012 10:21:08 AM UTC+1, Lukas Eder wrote:
>
> Hello Eric,
>
> > However, the Cart pojo could have joda-time type properties like
> LocalDate,
> > LocalDateTime and LocalTime (so no TimeZone).
> > And i noticed that jooq Convert class can only handle simple Date sql
> types
> > as Timestamp, Date or Time.
>
> You can always implement your own Converters in jOOQ, in order to
> transform JDBC date/time types into your own custom ones. Some
> examples are given here:
>
> http://www.jooq.org/doc/2.6/manual/sql-execution/fetching/data-type-conversion/
>
>
> In principle, this works for JodaTime as well. However, it doesn't
> work automatically for record to POJO mapping. I think you've
> discovered an important missing feature here. I've registered #2029
> for this:
> https://github.com/jOOQ/jOOQ/issues/2029
>
> I currently don't see an easy workaround, short of manual mapping from
> Record to Cart. Maybe someone else on this list has run into a similar
> problem, before?
>
> > Would it be possible to handle these joda-time types ? Or possible to
> use
> > custom converters, like inside Routines ?
>
> Unfortunately, jOOQ Routines (e.g. generated ones) currently don't
> support jOOQ Converters.
>
> > Or maybe there is another possibility with jooq to obtain a Pojo result
> from
> > a Sproc ? (I use Sql Server)
>
> This is a pending feature request:
> https://github.com/jOOQ/jOOQ/issues/710
>
> Currently, the only way to fetch records (and thus, pojos) from SQL
> Server stored procedures is through plain SQL, the way you showed in
> your example.
>