ztx1491 / hibernate-generic-dao

Automatically exported from code.google.com/p/hibernate-generic-dao
1 stars 0 forks source link

JPQL can not support asterisk (*) in COUNT function #66

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
"The COUNT function takes either an identification variable or a path 
expression as its argument. This path expression can resolve to a state field 
or a single-valued association field", which is stated in JPQL.

The query "select count(*) from employee e" can not work. It could be resolved 
by replacing * with alias name, as below:

"select count(e) from employee e"

The method "_count(Class<?> type)" in BaseDAO, and method 
"generateRowCountQL()" in BaseSearchProcessor should be changed.

Original issue reported on code.google.com by Jirong.Gao on 1 Aug 2010 at 4:03

GoogleCodeExporter commented 8 years ago

Original comment by dwolvert on 7 Aug 2010 at 9:03

GoogleCodeExporter commented 8 years ago
Fixed for 0.5.2

Original comment by dwolvert on 22 Nov 2010 at 12:41

GoogleCodeExporter commented 8 years ago

Original comment by dwolvert on 22 Nov 2010 at 4:07

GoogleCodeExporter commented 8 years ago

Original comment by dwolvert on 27 Feb 2011 at 5:32