Search code examples
jooq

jOOQ difference between Record and TableRecord


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!


Solution

  • 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 output

    So for example a User and a UserRecord

    This might be a different question. jOOQ's code generator produces these artifacts for each table, depending on your configuration: