[JIRA] (HHH-15654) Window/Ordered set-aggregate function support for Criteria API
by Christian Beikov (JIRA)
Christian Beikov ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *created* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYmQxYjUwOWFh... ) / Improvement ( https://hibernate.atlassian.net/browse/HHH-15654?atlOrigin=eyJpIjoiYmQxYj... ) HHH-15654 ( https://hibernate.atlassian.net/browse/HHH-15654?atlOrigin=eyJpIjoiYmQxYj... ) Window/Ordered set-aggregate function support for Criteria API ( https://hibernate.atlassian.net/browse/HHH-15654?atlOrigin=eyJpIjoiYmQxYj... )
Issue Type: Improvement Assignee: Christian Beikov ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) Components: hibernate-core Created: 02/Nov/2022 01:58 AM Fix Versions: 6.2.0 Priority: Major Reporter: Christian Beikov ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... )
We need methods in the Criteria API ( HibernateCriteriaBuilder ) for creating window and ordered set-aggregate functions as that is currently impossible in an API supported way. I think it would be best to construct the window separately ( createWindow ) and add a windowFunction(String name, Class<T> type, JpaWindow window, Expression<?>... args) , which also allows reuse of the window. For ordered set-aggregate functions, we should add a functionWithinGroup(String name, Class<T> type, Order order, Expression<?>... args). Also, add a variant that allows passing the filter clause predicate.
It would be nice to add some convenience methods for certain functions
* ordered set-aggregate functions: listagg , mode , percentile_cont , percentile_disc
* window functions: row_number , first_value , last_value , nth_value , dense_rank , rank , percent_rank , cume_dist
( https://hibernate.atlassian.net/browse/HHH-15654#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-15654#add-comment?atlOrigin=ey... )
Get Jira notifications on your phone! Download the Jira Cloud app for Android ( https://play.google.com/store/apps/details?id=com.atlassian.android.jira.... ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100210- sha1:cad9577 )