Skip to content
New issue

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

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

Already on GitHub? # to your account

Between jpql macro doesn't support bindable parameters as arguments #4216

Open
syncro opened this issue Feb 26, 2025 · 0 comments
Open

Between jpql macro doesn't support bindable parameters as arguments #4216

syncro opened this issue Feb 26, 2025 · 0 comments
Labels
candidate Possible candidate for future releases in: data size: M

Comments

@syncro
Copy link
Contributor

syncro commented Feb 26, 2025

Environment

Jmix version: 1.x, 2.x

Bug Description

If you try to use "between" jpql-marco with anything except literal numbers and "now" as arguments "Mismatched token error" will be thrown

Image

Image

Other date jpql-marcos(e.g. "dateEquals") parameters support works fine.

Note: for many of cases expression like "now + :days" support is also required

Upd: changed type to feature as this behaviour is documented in exactly the same way

Steps To Reproduce

  1. create jpql method e.g. for dataloader query override
  2. make it use "between" macro function and bindable query parameter as an argument
  3. try to emit its execution
  4. see error exception

Current Behavior

The exception is thrown for any parameter usage case:
Caused by: io.jmix.data.impl.jpql.JpqlSyntaxException: Errors found for input jpql:[select e from LifeEvent e where @between(e.startDate, now, :days, day)] CommonErrorNode [<mismatched token: [@22,59:63=':days',<30>,1:59], resync=@between(e.startDate, now, :days, day)>]

Expected Behavior

Macro Arguments are pre-calculated and query works fine

Sample Project

testjmixbetween.zip

@syncro syncro added in: data triage Issue is waiting for triage type: bug Something isn't working and removed type: bug Something isn't working labels Feb 26, 2025
@glebfox glebfox added candidate Possible candidate for future releases size: M and removed triage Issue is waiting for triage labels Feb 28, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
candidate Possible candidate for future releases in: data size: M
Projects
None yet
Development

No branches or pull requests

2 participants