eclipse / jnosql

Eclipse JNoSQL is a framework which has the goal to help Java developers to create Jakarta EE applications with NoSQL.
Other
231 stars 72 forks source link

[BUG] JDQL queries with like operator not working #540

Closed m4ttek closed 3 months ago

m4ttek commented 3 months ago

Which JNoSQL project the issue refers to?

JNoSQL (Core)

Bug description

There is no way I can use @Query annotation properly with LIKE queries with params.

For example:

    @Query("where employeeName LIKE ?1 OR employeeSurname LIKE ?1")
    Page<EmployeeWorkflowContext> searchByPhrase(@Param("phrase") String phrase,
                                                 @NotNull PageRequest pageRequest,
                                                 @NotNull Order<EmployeeWorkflowContext> order);

It results in error while invoking:

WARNING: An exception mapping did not successfully produce and processed a response. Logging the exception propagated to the default exception mapper.
org.eclipse.jnosql.communication.QueryException: line 1:24 mismatched input '?' expecting STRING

It doesn't matter if I use named parameter or not - it's expecting string after "like":

JNoSQL Version

1.1.1

Steps To Reproduce

  1. Create a Repository with custom @Query method
  2. Use "LIKE" operator for this method with interpolated parameter.
  3. Invoke this method

Expected Results

No response

Code example, screenshot, or link to a repository

No response

otaviojava commented 3 months ago

Hey @m4ttek could you check it with SNAPSHOT?

m4ttek commented 3 months ago

Unfortunately, still not working on 1.1.2-SNAPSHOT image

otaviojava commented 3 months ago

I got it; it generates once a day. I am generating it for you.

m4ttek commented 3 months ago

Yes, and now it's working!

otaviojava commented 3 months ago

Thank you @m4ttek closing thi sissue.