-
Tested with JoSQL ver. 2.1
Two objects: user and userprop
parent child situation: The user object contains a java.util.Set of userprop objects.
I'm using bind variables to process the variables in the query.
Two queries:
SELECT * FROM user WHERE username = ? AND ( SELECT * FROM userProperties WHERE name = ? AND value= ? ).size > 0
query.setVariable(1, "johnnyTester");...
2009-03-30 16:50:35 UTC in JoSQL (SQL for Java Objects)
-
Hi again,
I've just read the message more carefully. There is of course no discrepancy between the two cases - IN and NOT IN.
Once again, thank you very much!
It is really wonderful to get a reply so quickly!
Regards.
Alex.
2009-02-05 11:42:04 UTC in JoSQL (SQL for Java Objects)
-
Ooo sorry Gary,
I just refreshed the page and posted my Message again :).
Thanks a lot for your answer and it definitely helps to solve my issue.
I have just a question concerning your first solution. Why should there be a difference in the way the subquery is built between an IN and a NOT IN statement?
SELECT * FROM Parent WHERE IN (SELECT * FROM children WHERE name = 'Santa') ;...
2009-02-05 11:25:06 UTC in JoSQL (SQL for Java Objects)
-
Hi there,
First, let me thank you for JoSQL. It's wonderful :) !
I'm using sub queries like:
SELECT * FROM Parent WHERE (SELECT * FROM children WHERE name = 'Santa') ;
My question: Can I express negation? Something like:
SELECT * FROM Parent WHERE NOT (SELECT * FROM children WHERE name = 'Santa') ;
The SQL equivalent to the above is:
SELECT * FROM Parent WHERE parentname NOT...
2009-02-05 11:12:08 UTC in JoSQL (SQL for Java Objects)
-
Hi there,
First, let me thank you for JoSQL. It's wonderful :) !
I'm using sub queries like:
SELECT * FROM Parent WHERE (SELECT * FROM children WHERE name = 'Santa') ;
My question: Can I express negation? Something like:
SELECT * FROM Parent WHERE NOT (SELECT * FROM children WHERE name = 'Santa') ;
The SQL equivalent to the above is:
SELECT * FROM Parent WHERE parentname NOT...
2009-02-03 18:13:52 UTC in JoSQL (SQL for Java Objects)