I would like to know what the difference is between a jOOQ Record
and a TableRecord
. So for example a User
and a UserRecord
. I can see that it has something to do with the actual nullability of a certain table, but why does everyone use the TableRecord
and when should I ever use the normal Record
?
Thanks!
There's a manual page about literally your question: Record
vs. TableRecord
. In short:
Record
is the generic super type of all jOOQ records.TableRecord
is a specific type of record, which can be associated with a table in your schema. This type is typically extended by code generation outputSo for example a
User
and aUserRecord
This might be a different question. jOOQ's code generator produces these artifacts for each table, depending on your configuration:
Table
(e.g. User
). You use this to construct type safe jOOQ queriesTableRecord
(e.g. UserRecord
). You can use this to simplify some CRUD operationsUser
, but in a different package). You can use this to map results to simple POJOs