Skip to content

Translate JpaSort.unsafe(…) used with Specifications to order-by Expression #3172

Closed
@icerockq

Description

@icerockq

spring boot 2.7.2

In these two cases I use the following expression: PageRequest.of(0, 10, JpaSort.unsafe("LENGTH(name)")) and my model has name property.

For exmaple if I using default method findAll(Specifiocation, Pageable), then I will get exception:
org.springframework.data.mapping.PropertyReferenceException: No property 'unsafe expression' found for type 'Entity'

But if I using method with @Query annotation then I will get success query.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions