How can I do this using querydsl?

I have this part of my query which I’m transforming into querydsl and I would like to know if there’s a way to achieve this transformation

Where...
...
and ce.id || ce.is_open not in (select fut_client.client_id || fut_client.is_available from future_client fut_client)")

Answer

Assumptions:

  • You’re using querydsl-sql
  • In the sql provided || is concatenation
  • id and client_id are numbers
  • is_open and is_available are strings
query.where(someRelationalPathBase.something.eq(someRelationalPathBase.somethingElse)
            .and(ce.id.stringValue().concat(ci.isOpen())
            .notIn(SQLExpressions.select(futClient.clientId.stringValue().concat(futClient.isAvailable))
            .from(futClient))));
Source: stackoverflow
The answers/resolutions are collected from stackoverflow, are licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0 .