In MongoDB, an IndexOutOfBound is thrown:
{quote} java.lang.IndexOutOfBoundsException: Index: 0 {quote}
with
{code} @Test public void testAVG() throws Exception { Long result = session.createQuery( "SELECT AVG(h.id) from Hypothesis h" ).uniqueResult(); assertThat( result ).onProperty( "id" ).containsOnly( "14", "15", "17" ); System.out.println( result ); }
{code}
Sometimes no error is thrown but the query does not return the expected result, like: {code} String countQuery = "SELECT COUNT(t.id) FROM " + shortClassName + " t ";
TypedQuery<Long> query = __entityManager.createQuery(countQuery, Long.class);
Long count = query.getSingleResult(); ... {code}
|