bestlong / krank

Automatically exported from code.google.com/p/krank
0 stars 3 forks source link

count(*) not working on OpenJPA #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Deploy GenericDaoJpa on OpenJPA 1.0.2
2. Execute count()

I've reported it to the OpenJPA team here:
https://issues.apache.org/jira/browse/OPENJPA-566

A nice workaround is using the following query:

Query query = em.createQuery("SELECT count(i) FROM " + entityName + " i");

This makes it work on Hibernate and OpenJPA.

Original issue reported on code.google.com by mathias....@gmail.com on 9 Apr 2008 at 9:04

GoogleCodeExporter commented 9 years ago
OpenJPA guys responded. Seems like count(*) is not valid EJBQL.

Original comment by mathias....@gmail.com on 10 Apr 2008 at 9:55