title: java.math.BigInteger cannot be cast to java.lang.Integer
body: <p>I'm getting the following exception. </p>
  
  <p>Caused by: </p>
  
  <blockquote>
    <p>java.lang.ClassCastException: java.math.BigInteger cannot be cast to
    java.lang.Integer</p>
  </blockquote>
  
  <p>with the following code</p>
  
  <pre><code>List queryResult = query.list();
  
  for (Iterator&lt;Object[]&gt; it = queryResult.iterator(); it.hasNext();) {
      Object[] result = it.next();
      Integer childId = (Integer) result[0];
      Integer grandChildCount = (Integer) result[1];
      CompanyNode childNode = childNodes.get(childId);
      childNode.setHasChildren(grandChildCount != 0);
      childNode.setIsLeaf(grandChildCount == 0);
  }
  </code></pre>
  
  <p>at this line </p>
  
  <pre><code>Integer grandChildCount = (Integer) result[1];
  </code></pre>
  
  <p>Does anybody have any idea?</p>