You might need to use a native query for that - the spec only allows the following for the COUNT (see in BNF):
[i]COUNT ( [DISTINCT ] identification_variable | state_field_path_expression | single_valued_association_path_expression)[/i]
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]
http://forums.java.net/jive/thread.jspa?messageID=238994