2016-06-22 18:25 GMT+02:00 Christian Meyer <[email protected]>:

> Hi Lukas,
>
> one quick question. Something I saw in your DAOImpl class: you cast a T to
> a Record (private equal method).
>
> return row(pk).equal((Record) id);
>
>
> Is this really safe and why? Maybe there's something I don't understand.
>

It's safe because the implicit contract on the type <T> is for:

- Single column primary keys to be of the type T of the column
- Composite primary keys to be of the type Record[N]<T1, T2, ..., T[N]>

It's a contract, but it cannot be easily expressed in code. The code
generator will adhere to this contract. Custom DAO implementations might
not, but as many other jOOQ APIs, DAO is not meant for random
implementation by users, so it's... "safe" :)

Hope this helps,
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/d/optout.

Reply via email to