Skip to content

Hibernate 7: accept a map of sort properties in criteria query arguments #17166

Backlog

Description

@jdaugherty

Problem

The latest review of #17070 requests a focused Hibernate 7 counterpart: a map of sort properties in a criteria query still throws ClassCastException on 8.0.x and at the reviewed head of #17079.

The existing report #14653 describes this API and points to a Hibernate 5 fix on 7.0.x. This issue tracks the remaining Hibernate 7 implementation, separately from that fix and from the requested-join scope of #17079.

Reproducer and expected result

For a domain class Book with a String title, save several books, including two with the same title, and call:

Book.createCriteria().list(sort: [title: 'desc', id: 'asc']) {
    like('title', '%')
}

The query should apply every entry in map order, with the requested direction, instead of casting the map to a string. Cover the same call with max and offset so the requested ordering is applied before paging, and retain the existing single-property sort behavior.

Release ordering

Implement this as the Hibernate 7 counterpart of #17070 on 8.0.x and coordinate it before that part is released across both modules. Keep requested-join handling in #17079; this issue does not expand that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions