Closed robertandrewbain closed 9 years ago
What did you try? Didn't the following work?
select(select(fooExpr).from(someTable)).from(someOtherTable)
Hi Timo, in response to your question, I was completely barking up the wrong tree last night - long day. I've updated the issue and its title as I believe I've got to the bottom of the problem I was experiencing. Thanks as always for your help.
@robertandrewbain Feel free to provide a PR for that.
@timowest no problem, I'll attempt to get that done today. I'll put in isNotNull()
too, for completeness.
In querydsl 3 you could write a subquery and call
isNull()
on it. However it took me a while to figure out how to do it using querydsl 4. I think the API could be improved.To demonstrate, I was trying to do something like this:
The problem is that
isNull()
is not present. Looking at theisNull()
method inSimpleExpression
I realised it was callingExpressions.booleanOperation(Ops.IS_NULL, mixin)
which led me to look at the usages ofOps.IS_NULL
and discoverExpressionUtils
public static Predicate isNull(Expression<?> left)
method, which done the trick.However, I think it should go in
ExtendedSubQuery
asBooleanExpression isNull(Expression<? extends T> expr)
.