'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 1:[1]
There's a manual page about literally your question: Record vs. TableRecord. In short:
Recordis the generic super type of all jOOQ records.TableRecordis 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
Userand aUserRecord
This might be a different question. jOOQ's code generator produces these artifacts for each table, depending on your configuration:
- The
Table(e.g.User). You use this to construct type safe jOOQ queries - The
TableRecord(e.g.UserRecord). You can use this to simplify some CRUD operations - The POJO (e.g.
User, but in a different package). You can use this to map results to simple POJOs
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
