title: JPQL is not grouping null values
body: <p>I have a JSF application which uses JPA to manage database transactions.</p>
  
  <p>In my data structure there are bills[Bill]. One bill can have many bill items[BillItem]. Bill items has a relationship to Item. Bills may have an institution and a collecting centre. But both can be null in some bills. I want to group the Bill Items by Item, Institution and Collecting Centre and get the count. The following jpql lists only those with Institutions and Collecting Centres. That means it does not group nulls.</p>
  
  <p>I use EclipseLink 2.4 and MySQL.</p>
  
  <pre><code>    String jpql;
      Map m = new HashMap();
      jpql = "Select new com.divudi.data.dataStructure.ItemInstitutionCollectingCentreCountRow(bi.item, bi.bill.institution, bi.bill.collectingCentre, count(bi)) "
              + " from BillItem bi "
              + " where bi.bill.createdAt between :fd and :td "
              + " and type(bi.item) =:ixbt "
              + " and bi.retired=false "
              + " and bi.bill.retired=false "
              + " and bi.bill.cancelled=false "
              + " and bi.retired=false ";
      jpql = jpql + " group by bi.item, bi.bill.institution, bi.bill.collectingCentre";
      jpql = jpql + " order by bi.bill.institution.name, bi.bill.collectingCentre.name, bi.item.name ";
      m.put("fd", fromDate);
      m.put("td", toDate);
      m.put("ixbt", Investigation.class);
      insInvestigationCountRows = (List&lt;ItemInstitutionCollectingCentreCountRow&gt;) (Object) billFacade.findAggregates(jpql, m, TemporalType.DATE);
      System.out.println("sql = " + jpql);
      System.out.println("m = " + m);
      System.out.println("insInvestigationCountRows.size() = " + insInvestigationCountRows.size());
  </code></pre>