I'm getting the following exception. 

Caused by: 

> 
> java.lang.ClassCastException: java.math.BigInteger cannot be cast to
>  java.lang.Integer
> 
> 
> 

with the following code

```
List queryResult = query.list();

for (Iterator<Object[]> 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);
}

```

at this line 

```
Integer grandChildCount = (Integer) result[1];

```

Does anybody have any idea?