title: how to use postgresql array_agg with JPA+hibernate 3.6
body: <p>I make this request with no problem:</p>
  
  <pre><code>select ac.reg, param.alias, array_agg(numValue) 
  from Sample   
  group by ac.reg, param.alias  
  order by ac.reg ASC
  </code></pre>
  
  <p>now, I want more than the mean value. how can I get all the values as an array? I use postgresql as DB, an I know there is a array_agg method that returns exaclty what I want. but such aggregation seems not to be implemented in hibernate.</p>
  
  <pre><code>select ac.reg, param.alias, array_agg(numValue) 
  from Sample   
  group by ac.reg, param.alias  
  order by ac.reg ASC
  </code></pre>
  
  <p>raises the exception:</p>
  
  <pre><code>A java.lang.IllegalStateException has been caught, No data type for node: org.hibernate.hql.ast.tree.MethodNode 
  \-[METHOD_CALL] MethodNode: '(' +-[METHOD_NAME] IdentNode: 'array_agg' {originalText=array_agg} \-[EXPR_LIST] SqlNode: 'exprList' \-[DOT] DotNode: 'sample0_.num_value' 
  {propertyName=numValue,dereferenceType=ALL,propertyPath=numValue,path={synthetic-alias}.numValue,tableAlias=sample0_,className=models.Sample,classAlias=null} +-[IDENT] IdentNode: '{synthetic-alias}' {originalText={synthetic-alias}} \-[IDENT] IdentNode: 'numValue' {originalText=numValue}
  </code></pre>