This question is saying that there are 2 Customers and each Customer has 3 Orders, the correct question is saying that list will contain 12 , In my understand it should be 6 2x3=6
Am I missing something?
THanks.
About Question enthuware.oce-jpad.v6.2.579 :
Moderator: admin
-
- Posts: 6
- Joined: Mon Sep 23, 2013 5:19 pm
- Contact:
-
- Site Admin
- Posts: 10078
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.579 :
Each customer has three orders. So there are 6 orders.
-Paul.
-Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 358
- Joined: Fri Nov 29, 2013 8:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.579 :
In the explanation :
"cq.where(cb.equal(custRoot, orderRoot.get("customer"))).distinct(true);
to avoid duplicates.
I guess this can be this:The above code can be fixed to return only those customers who have at least one order by added a where clause like this:
cq.where(cb.equal(custRoot, orderRoot.get("customer")));
"cq.where(cb.equal(custRoot, orderRoot.get("customer"))).distinct(true);
to avoid duplicates.
Who is online
Users browsing this forum: No registered users and 9 guests