Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

381
Vistas
QueryDsl how to use exist() to return boolean

I want to upgrade queryDsl from verision 3 to version 4. But i've an issue with exist() In QueryDsl 3 exist return a Boolean but in QUeryDSL 4 it return a BooleanOperation. In my case i really want the boolean but i don't know how to retrieve it.

The best solution i've found is to do

.fetchCount() >0 

But I want to know if another (better) solution exist.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Another option would be something like:

queryFactory.select(queryField).from(qTable)
            .where(queryField.eq(value))
            .groupBy(queryField)
            .having(qTable.uuid.count().gt(0))
            .fetchOne() != null;

This passes the greater than responsibility over to the query. However it is possibly less readible so will depend on the requirements which is better.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda