About Question enthuware.oce-jpad.v6.2.494 :

Moderator: admin

Post Reply
evefuji
Posts: 21
Joined: Fri Apr 11, 2014 8:57 pm
Contact:

About Question enthuware.oce-jpad.v6.2.494 :

Post by evefuji »

The JPQL:
SELECT p.presenter from Presentation p  
This does not throws Exception that not has join in query?

admin
Site Admin
Posts: 10045
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.494 :

Post 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.
If you like our products and services, please help us by posting your review here.

3uPh0riC
Posts: 2
Joined: Sun Dec 14, 2014 12:39 am
Contact:

Re: About Question enthuware.oce-jpad.v6.2.494 :

Post 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

admin
Site Admin
Posts: 10045
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.oce-jpad.v6.2.494 :

Post 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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 30 guests