Hi Etienne,

That would be a really great feature, but it's not possible to do with jOOQ
3.10 (and 3.11) yet. The relevant feature request is here:
https://github.com/jOOQ/jOOQ/issues/2530

It would be an awesome feature to have in jOOQ for many reasons, including
the one you've mentioned. Another use-case is to be able to group audit
fields. A third one is for composite keys to be one logical value, which
would make type safe joining on those keys much more easy, as only one
"virtual" column would need to be joined.

Unfortunately, it is not exactly trivial to implement...

Thanks,
Lukas

2018-04-28 11:04 GMT+02:00 <[email protected]>:

> Hi
>
> Using custom converters works great for mapping single fields to a given
> type. How would I go about it if I wanted to coerce two db fields into a
> single custom type?
>
> e.g. let's say I have a db table with two fields called *start_time* and
> *end_time*, each of type TIMESTAMP, and I want them to be mapped by jOOQ
> to Pair<Instant, Instant> when reading entities from the db?
>
> If I could define that mapping logic once with jOOQ, this would remove
> repeated Java code that currently reads both fields, and then coerces them.
>
> I'm curious.
>
> Etienne
>
> --
> 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.

Reply via email to