Skip to content

Query parser should handle safe navigation SpEL operator #2875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
gregturn opened this issue Mar 20, 2023 · 3 comments
Closed

Query parser should handle safe navigation SpEL operator #2875

gregturn opened this issue Mar 20, 2023 · 3 comments
Labels
in: query-parser Everything related to parsing JPQL or SQL status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement

Comments

@gregturn
Copy link
Contributor

In this example (from #2032):

public interface BookErrorRepository extends Repository<BookError, Long> {

    @Query("FROM BookError b WHERE portal = :portal AND date >= :startDate AND date <= :endDate" +
           " AND (:search IS NULL OR keyword LIKE :search%)" +
           " AND (:state IS NULL OR errors = :#{#state?.shortMessage})")
    Page<BookError> findByPortalInDateRange(@Param("portal") Portal portal,
            @Param("startDate") LocalDate startDate,
            @Param("endDate") LocalDate endDate,
            @Param("search") Optional<String> search,
            @Param("state") Optional<State> state,
            Pageable pageable);

}

...the SpEL safe navigation operation (?.) isn't handled this needs to added to the parser grammar and properly handled in rendering and transforming queries.

@mp911de
Copy link
Member

mp911de commented Mar 21, 2023

I'm not sure this is related to query parsing. It's more an aspect of rewriting the query into a valid JPQL/HQL syntax and replacing SpEL with parameter placeholders.

@gregturn
Copy link
Contributor Author

I believe that thanks to 5f244c4, there is no longer any need to handle SpEL in the query parsers, so this issue is no longer relevant.

@gregturn gregturn removed this from the 3.1 RC1 (2023.0.0) milestone Mar 22, 2023
@gregturn gregturn added the status: declined A suggestion or change that we don't feel we should currently apply label Mar 22, 2023
@gregturn
Copy link
Contributor Author

See #2881 for efforts to remove SpEL support from the query parsers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: query-parser Everything related to parsing JPQL or SQL status: declined A suggestion or change that we don't feel we should currently apply type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants