Are you asking a question? ... or are you just asserting that it works as defined in the spec?
Thanks, Rick On Thu, Sep 9, 2010 at 9:32 AM, Vera Filippova <[email protected]> wrote: > Result of aggregate function MAX is 0 on empty table. > I can find in JPQL reference "If SUM , AVG, MAX, or MIN is used, and there > are no values to which the aggregate function can be applied, the result of > the aggregate function is NULL." > > // The following example will print [0] > String query = "SELECT MAX(obj.number) FROM " + > Bean.class.getSimpleName() + " obj"; > System.out.print(em.createQuery(query).getResultList().isEmpty()); > > With openjpa 1.2.1 this example will print [null] as expected. > > Thank you > -- > Vera Filippova >
