Closed mkupriichuk closed 1 year ago
Hi,
What you need to use is Ignorable boolean expression; in that way, your query will look like:
connection
.selectFrom(saProductTable)
.innerJoin(basketAnalysisQuery)
.on(basketAnalysisQuery.productId.equals(saProductTable.id))
.where(basketAnalysisQuery.value.greaterOrEquals(1))
.and(basketAnalysisQuery.productId.in(subquery).onlyWhen(categoryId !== undefined))
);
Let me know if that works for you.
Yes. works nice, thanks
Hello We can use subquery inside
in
:But what if we need to use
.and(basketAnalysisQuery.productId.in...
only ifcategoryId !== undefined
:It is possible to do this with
inIfValue
?Because now i get error like this:
Or maybe it has to be done in some other way?
Thanks