Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-1460

$filter not working in JPA/Olingo 2.0.11 with MySQL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • V2 2.0.11
    • None
    • odata2-jpa
    • None
    • spring-boot 2.3.0, windows, MariaDB

    Description

      I made an odata service with olingo2jpa and spring-boot based on this GitHub repository

      I've set up the project to use MariaDB database and it works quiet good.

      However, the project is a little bit old and I tried to upgrade it!

      In the first step I tried to update the libraries versions like this:
       

      <parent>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-parent</artifactId>
         <version>2.3.0.RELEASE</version>
      </parent>
      <properties>
         <java.version>1.8</java.version>
         <cxf.version>3.3.6</cxf.version>
         <olingo.version>2.0.11</olingo.version>
      </properties>

      when I try the following request that I use a filtering on a column of type string:
       
      http://localhost:9090/odata.svc/Members?$format=json&$filter=FirstName eq 'Jack'

      I receive an error message in response to my request in postman or browser, like this:
       

      {
          "error": {
                     "code": null,
                     "message": {
                              "lang": "en",
                              "value": "org.hibernate.exception.SQLGrammarException: could not extract ResultSet"
                     }
          }
      }
      

       

       

      It actually generates a wrong query on database while it has the correct dialect!

      What is the problem here? It uses escape '\' instead of escape '
      ' in the query.

      What is your suggestion for solving this issue?

      The interesting part is if I have $filter and $expand at the same time in my query then it will not inject escape '\' in the query anymore. 

       

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            mjz Mahdi Ansari
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: