spring-data-jpa icon indicating copy to clipboard operation
spring-data-jpa copied to clipboard

Update JPQL and HQL parsers with newly introduced JPA 3.2 keywords

Open mp911de opened this issue 2 years ago • 4 comments

See https://deploy-preview-652--jakartaee-specifications.netlify.app/specifications/persistence/3.2/

  • Adds union, intersect, except, cast, left, right, and replace for Jakarta Persistence QL and criteria queries
  • Adds || string concatenation operator to Jakarta Persistence QL
  • Adds support for specifying null precedence when ordering Jakarta Persistence QL and criteria queries

mp911de avatar Sep 01 '23 06:09 mp911de

Does null precedence work on Page requests? Because its not working for me with version 3.2.1

Sort.Order sort = switch (direction != null ? direction : "") {
            case "asc" -> Sort.Order.asc(sortBy);
            case "desc" -> Sort.Order.desc(sortBy).nullsLast();
            default -> Sort.Order.asc("code");
        };

PageRequest pageRequest = PageRequest.of(
                alarmPageableFilter.getPageNumber(),
                alarmPageableFilter.getPageSize(),
                Sort.by(sort));

Page<Alarm> page = alarmRepository.findAll(getByFilter(alarmPageableFilter), pageRequest);

Nendanfito avatar Jun 05 '24 12:06 Nendanfito

No, it's not working with 3.2.1 because the JPA spec level is at 3.1. Starting with JPA 3.2, the API will specify null precedence (see https://projects.eclipse.org/projects/ee4j.jpa/releases/3.2)

mp911de avatar Jun 06 '24 07:06 mp911de

I have the same issue too. Dont understand why it's happen

ducanh2110 avatar Jun 20 '24 15:06 ducanh2110

@mp911de and @christophstrobl - would you guys know when the issue that @Nendanfito explained here will be fixed?

joseardaiz avatar Jun 28 '24 16:06 joseardaiz