Hi Dennis,

Thanks for your investigation. I think in order to be able to fully
understand and hopefully reproduce the problem, I would probably need
the following:

- DDL of the UPLOAD table
- The generated classes for the UPLOAD table
- The converters that are involved here

2013/4/14 Dennis Fischer <[email protected]>:
> Oh boy,
>
> taking a look at jooqs source code showed me the true problem:
> http://www.jooq.org/doc/3.0/manual/code-generation/custom-data-types/
> describes how to use the "calendar converter" - well I did so. If you take a
> look at the first stacktrace
>
>>>     at org.jooq.tools.Convert$ConvertAll.toDate(Convert.java:781)
>>> ~[jooq-3.0.0-RC2.jar:na]
>>>     at org.jooq.tools.Convert$ConvertAll.from(Convert.java:677)
>>> ~[jooq-3.0.0-RC2.jar:na]
>>>     at org.jooq.tools.Convert.convert0(Convert.java:291)
>>> ~[jooq-3.0.0-RC2.jar:na]
>>>     at org.jooq.tools.Convert.convert(Convert.java:283)
>>> ~[jooq-3.0.0-RC2.jar:na]
>>>     at org.jooq.tools.Convert.convert(Convert.java:344)
>>> ~[jooq-3.0.0-RC2.jar:na]
>
>
> It follows each step down to ConvertAll.from:677 -> toDate is called, though
> I don't know why this check returns true: (fromClass = Long.class)
>
>> java.util.Date.class.isAssignableFrom(fromClass)
>
>
> Whatever - continuing the stacktrace:
> You take a look at it and think: mh - seems alright, I got my Date, Time,
> Timestamp, Date and Calendar conversion here. True - but even if this method
> is the right one to use - it fails.
> Why: My toClass is "GregorianCalendar.class" - the condition checks for
> "Calendar.class" only.
>
>> toClass == Calendar.class
>
>
> Sure - all conditions in this method will fail for GregorianCalendar.class
> and the exception is thrown.
> For my needs I quickfixed the generated jooq code to use the "Calendar" and
> not GregorianCalendar.

I don't think that this is the actual problem here. Yes, quick-fixing
your generated code will work because of the above. But the point is
still that jOOQ doesn't seem to know how to convert from Long ->
Timestamp -> GregorianCalendar, even if it should.

Cheers
Lukas

-- 
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.


Reply via email to