aspose file tools*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes JPQL doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "JPQL doubt" Watch "JPQL doubt" New topic
Author

JPQL doubt

Aditya Vasudeva
Ranch Hand

Joined: May 27, 2008
Posts: 76
in the spec, it clearly says that a path expression in the SELECT clause cannot be composed to get a collection by another path expression. To get a collection, an identification variable must be declared in the FROM clause.

If this is so, then why is the following code correct in one of the enthuware questions:


where, presentations is a collection field in Student !!


the question is in Test 2 of Enthuware.
please help...
Vinay Nath
Ranch Hand

Joined: Jul 06, 2008
Posts: 85
you can use aggregate functions, coz it results a scalar, Only when the result can be a collection it is a problem.


SCDJWS 5.0, SCBCD 5.0, SCWCD 5.0, SCJP 5.0
Rafael Rocha
Greenhorn

Joined: Jul 07, 2006
Posts: 20
Originally posted by Vinay Nath:
you can use aggregate functions, coz it results a scalar, Only when the result can be a collection it is a problem.

i have same doubt. i always meet that function 'COUNT' don't accept object complex in parameter function agregate.

how is this?
[ July 19, 2008: Message edited by: Rafael Rocha ]

SCJP 1.5 : SCWCD 1.4 : SCBCD 5.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JPQL doubt
 
Similar Threads
Enthuware question on inner join
Invalid query?
Qtn Reg EJBQL in HFEJB.
JPQL doubt
Path expression that evaluates to a collection