Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

244
Visualizações
using sub-query in jooq's seek api

I am evaluating using JOOQ in our solution where we expose data using REST API and checking if the following feature can use jooq's seekAfter and seekBefore api.

suppose i have a table like

CREATE TABLE Test (
  Id Int NOT NULL PRIMARY KEY,
  Sid varchar(34) NOT NULL,
  ....
)

We want to do paging using the Id field, but don't want to expose it to the user. We hand out next and previous paging arguments as tokens as part of response.

currently we are building query like

SELECT ... FROM Test WHERE Id > (SELECT Id FROM Test WHERE Sid=?) LIMIT 10;

Is it possible to give it an expression to jooq's seek api instead of literal values ?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

You could do something along the lines of this:

// Assuming this static import:
import static org.jooq.impl.DSL.*;

DSL.using(configuration)
   .select()
   .from(TEST)
   .orderBy(TEST.ID)
   .seekAfter(field(select(TEST.ID).from(TEST).where(TEST.SID.eq(sid))))
   .limit(10)
   .fetch();

Essentially, this is wrapping a Select<? extends Record1<T>> type in a Field<T> type with DSL.field(Select)

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda