Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:
Description
I would like to be able to write
def commentsByUserAndArticle = Comment.createCriteria().list {
projections {
countDistinct('id', 'commentCount')
groupProperty('userAccount')
groupProperty('article')
having {
gt('commentCount', 5)
}
}
order('commentCount', 'desc')
}
Instead, I currently have:
def commentsByUserAndArticle = Comment.executeQuery(
"select count(c.id), c.userAccount, c.article \
from my.domain.Comment c \
group by c.userAccount, c.article \
having count(c.id) > :abuseIndicator \
order by count(c.id) desc",
["abuseIndicator":5L])
It might be that this isn't supported by Hibernate itself; I'm not that familiar with the codebase, but thought this would be a nice enhancement to the createCriteria functionality.
Activity
- All
- Comments
- Work Log
- History
- Activity
- Git Commits
Depends on https://hibernate.onjira.com/browse/HHH-1043