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
|