Java jOOQ-方法调用

Java jOOQ-方法调用,java,sql,methods,invoke,jooq,Java,Sql,Methods,Invoke,Jooq,我对在以下示例jOOQ语句中调用方法count()有疑问: create.select(AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME, count()) .from(AUTHOR) .join(BOOK).on(AUTHOR.ID.equal(BOOK.AUTHOR_ID)) .where(BOOK.LANGUAGE.eq("DE")) .and(BOOK.PUBLISHED.gt(date("2008-01-01")))

我对在以下示例jOOQ语句中调用方法count()有疑问:

create.select(AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME, count())
      .from(AUTHOR)
      .join(BOOK).on(AUTHOR.ID.equal(BOOK.AUTHOR_ID))
      .where(BOOK.LANGUAGE.eq("DE"))
      .and(BOOK.PUBLISHED.gt(date("2008-01-01")))
      .groupBy(AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME)
      .having(count().gt(5))
      .orderBy(AUTHOR.LAST_NAME.asc().nullsFirst())
      .limit(2)
      .offset(1)
      .forUpdate()
      .of(AUTHOR.FIRST_NAME, AUTHOR.LAST_NAME)
我曾尝试创建这样的机制来调用方法,而不使用对象/类引用,但我已经放弃了。真的有可能实现吗

谢谢你的帮助

Wicia

坚持住!:-)

你引用的是网站上的第一个例子。我建议按照下面的(我知道,这听起来像是我在给你发短信。很抱歉),你会发现一些解释,例如

// Whenever you see "standalone functions", assume they were static imported 
// from org.jooq.impl.DSL. "DSL" is the entry point of the static query DSL

exists(); max(); min(); val(); inline();
// correspond to DSL.exists(); DSL.max(); DSL.min(); etc...
还显示了如何执行此操作,即使用静态导入:

// For convenience, always static import your generated tables and
// jOOQ functions to decrease verbosity:
import static test.generated.Tables.*;
import static org.jooq.impl.DSL.*;
请注意,有一个待定的功能请求需要改进手册和带有工具提示的网站,以便向新用户解释这些内容,一旦您掌握了jOOQ,这将很快成为常见做法