我们如何使用 JOOQ 计算行数?

How do we count rows using JOOQ?

我们在数据库中有一个名为 Books 的 table,我们如何计算 JOOQ 的图书记录总数?

int count = 
DSL.using(configuration)
   .selectCount()
   .from(Books)
   .fetchOne(0, int.class);

祝一切顺利!