Hi all,
it's a little bit crazy to write in german forum in english :) - but I start it, I finish with it.
OK, thanks sebastian for your answer, but it is not a realy good solution because i search for coupons which have accounts but not from the specific. Thats the reason why size == 0 don't go.
I haven't found a solution or example on hibernate.org
But I have try many select statements and at last I've do the best - I translate the "normal" sql-statement into HQL :)
Here are my solution - may be it's not the best and fastest but it works:
SELECT c FROM Coupon c WHERE c._global = true AND c._id NOT IN
(SELECT cp._id FROM Coupon cp LEFT JOIN cp._accounts a WHERE a._id = :pAccountId AND cp._global = true)
Thanks for help and reading this posting.
Best regards - and next time in german :)
soe
|