Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPQL doubt

 
Aditya Vasudeva
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can use aggregate functions, coz it results a scalar, Only when the result can be a collection it is a problem.
 
Rafael Rocha
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic