Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Blocker
-
Resolution: Fixed
-
Affects Version/s: 2.0-RC1
-
Fix Version/s: 2.0-RC2
-
Component/s: Persistence
-
Labels:
-
Environment:Win 7
Description
totalCount property to get the number of entries after applying a criteria query is broken.
For example, having
def authorList = Author.createCriteria().list(max: params.max, offset: params.offset){
ilike('name', '%a%')
}
authorList.totalCount always returns the total number of Author records and not only those with 'a' symbol in 'name' field.
Issue Links
- is related to
-
GRAILS-2672
Return PagedResultList in case list* methods are provided with max and offset param
-
- relates to
-
GRAILS-8365
totalCount creates additional order by statement
-
Same issue here. The criteria is just omitted in the SQL query that is generated when totalCount is invoked/accessed.
In 1.3.7. there was an additional limit (at least in the query where I stumbled upon this issue) which is missing as well.
Win 7, Postgres 9.0, postgresql-9.1-901.jdbc4, JDK 6.0.29 (all 64-bit)