What does EntityManager.getSingleResult() return for a COUNT query?
EntityManager.getSingleResult()
So.. what is the precise runtime type of foo?
Object foo = em.createQuer
AFAIK COUNT function returns Long