记录和TableRecord之间的JOOQ差异
我想知道JOOQ 记录
和 tableerecord
之间的区别。因此,例如用户
和 userrecord
。我可以看到这与某个表的实际无效性有关,但是为什么每个人都使用 tableerecord
以及我什么时候应该使用普通 record
?
谢谢!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一个关于您的问题的手册页面:记录 vs.
tableerecord
。简而言之:记录
是所有JOOQ记录的通用超级类型。tableecord
是一种特定的记录类型,可以与模式中的表相关联。这种类型通常由代码生成输出这可能是一个不同的问题。 JOOQ的代码生成器为每个表生成这些工件,具体取决于您的配置:
表
(例如用户
)。您可以用它来构建键入安全jooq查询userrecord
)。您可以将其用于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 outputThis 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