Page 1 of 1
About Question enthuware.oce-jpad.v6.2.494 :
Posted: Fri Apr 11, 2014 8:59 pm
by evefuji
The JPQL:
SELECT p.presenter from Presentation p
This does not throws Exception that not has join in query?
Re: About Question enthuware.oce-jpad.v6.2.494 :
Posted: Fri Apr 11, 2014 9:56 pm
by admin
A join is required when you want to create an identification variable and use that variable. For example,
SELECT p.presenter from Presentation p inner join Student s where s.name='bob'
Here you need to use explicit join to access s.
The specification does not prohibit join less query neither does it mandate the use of explicit join for returning single valued expression that belongs to the selected entity.
HTH,
Paul.
Re: About Question enthuware.oce-jpad.v6.2.494 :
Posted: Mon Jan 19, 2015 12:36 pm
by 3uPh0riC
Hi guys
I have a question here please, sorry if im missing something.
There is a Cartesian join happening in this question, and the answer says it returns 4 results. There are 2 tables, with 2 linking tables each.
In Test 2 Question 20 there is also a cartesian join. In that question there are 2 tables with 3 linking tables each. The answer says it does cartesian join by taking 2 * 6 = 12. This is not the same as the answer in this question? If they were the same the answer to this question would be 2*4=8?
Thanks
Re: About Question enthuware.oce-jpad.v6.2.494 :
Posted: Tue Jan 20, 2015 9:03 pm
by admin
A cartesian product is not happening in this question ( 2.494 ). There is an inner join happening here between student and presentation because of p.presenter, which results in 4 unique rows (student+presentation). The only reason you see duplicate students is because the presentation part of the resulting join is ignored. A cartesian product would have returned 8 (4*2) rows.
In 2.579, the query is not using customer.customerOrder. It is retrieving customer, customerOrder. It is not forming a join and that is why it is a cartesian product.
HTH,
Paul.