About Question com.enthuware.ets.scbcd.v5.2.128 : test 2 question 22
Posted: Mon Jun 27, 2011 8:12 am
Hi,
Considering the COUNT aggregate function the fourth proposition in this question (SELECT COUNT (s.presentations)...) suggests that we can uses collection_valued association path expression.
It is confirmed with Glassfish/toplink (IR). Furthermore If we read the persistence spec (JPA 1.0). p101 about COUNT, it seems to confirm this assertion : COUNT can use collection_valued association as argument, since there no detail.
But if we look at the definition of aggregate_expression in 4.4 section (BNF) or in the SELECT syntax p 99, it seems that only single_valued are permitted as association path expression. The book pro JPA 1.0 confirms this assertion. Tests with Hibernate (non IR) too.
Is there a GAP in the spec ?
So does COUNT accepts or not collection_valued association path expressions as argument ?
thanks by advance.
Best regards,
Alex
Considering the COUNT aggregate function the fourth proposition in this question (SELECT COUNT (s.presentations)...) suggests that we can uses collection_valued association path expression.
It is confirmed with Glassfish/toplink (IR). Furthermore If we read the persistence spec (JPA 1.0). p101 about COUNT, it seems to confirm this assertion : COUNT can use collection_valued association as argument, since there no detail.
But if we look at the definition of aggregate_expression in 4.4 section (BNF) or in the SELECT syntax p 99, it seems that only single_valued are permitted as association path expression. The book pro JPA 1.0 confirms this assertion. Tests with Hibernate (non IR) too.
Is there a GAP in the spec ?
So does COUNT accepts or not collection_valued association path expressions as argument ?
thanks by advance.
Best regards,
Alex