Page 1 of 1
					
				About Question enthuware.oce-jpad.v6.2.582 :
				Posted: Wed May 30, 2012 3:48 pm
				by cosminvacaroiu
				Isn't it incorrect to do a:
Code: Select all
select s.presentations from Student s;
 
			 
			
					
				Re: About Question enthuware.oce-jpad.v6.2.582 :
				Posted: Wed May 30, 2012 5:19 pm
				by admin
				Why do you think it is incorrect?
			 
			
					
				Re: About Question enthuware.oce-jpad.v6.2.582 :
				Posted: Thu May 31, 2012 2:10 am
				by Guest
				admin wrote:Why do you think it is incorrect?
Because presentations is a collection. And you can't have a collection in the select list.
 
			 
			
					
				Re: About Question enthuware.oce-jpad.v6.2.582 :
				Posted: Thu May 31, 2012 6:54 pm
				by admin
				You are right but this question doesn't have this option.
BTW, you can select a collection but you have to declare an identification variable for it in the from clause:
select p from Student s join s.presentations p;
			 
			
					
				Re: About Question enthuware.oce-jpad.v6.2.582 :
				Posted: Wed Oct 10, 2012 9:58 am
				by heaven
				The assumed correct answer D is in fact illegal by spec as stated above.
cq.select(student.<Presentation>get("presentations")) is in fact select of a collection (select s.presentations ...)
			 
			
					
				Re: About Question enthuware.oce-jpad.v6.2.582 :
				Posted: Sun Oct 14, 2012 10:03 am
				by admin
				You are right. 
Code: Select all
cq.select(student.<Presentation>get("presentations")).distinct(true); //5
 has now been changed to
Code: Select all
cq.select(presentation).distinct(true); //5
  
thank you for your feedback!