Code Monkey home page Code Monkey logo

Comments (4)

torshid avatar torshid commented on May 24, 2024

Thanks for your contribution. :)

The origin of the % character is actually JPA itself, that's the character it uses for the like function. As you can see here I simply call the builder's like method without transforming the inputs (besides uppercasing):

return criteriaBuilder.like(criteriaBuilder.upper((Expression) leftExpression),
            criteriaBuilder.upper((Expression<String>) rightExpression));

The % character should not be a problem if it is properly encoded to %25 when calling the API, since Spring decodes it back naturally. For example, it works fine with Spring's RestTemplate, Postman (encodes by default), or Swagger UI.

However I would like to have more info on your use case, which client are you using?

Since it seems to be a standart to use the asterisk, I just released a new version (0.9.5) with support for it.

That's out off topic but how did you find the repo? :)
I have also written a post on Medium some time ago, would really appreciate if you can share it.

from springfilter.

marcopag90 avatar marcopag90 commented on May 24, 2024

Mhh that's strange, maybe i need to dig around some options with the client, as i was using Postman and i had to manually encode with %25 in the url to make it work, that's why i opened the issue.
Yea you are right, i know it's a JPA built-in feature (well, JPA itself just converts the parameter to a sql query in the criteria).
I think different libraries use the asterisk to avoid url enconding problems from the beginning.
I wanted something that could use JPA Repositories and entity graphs, to avoid hibernate n+1 queries when joining data and handle LAZY objects, and your library works like a charm :).

Anyways...I'm definitely sharing it dudeπŸ‘ .
I found your repo from this post jirutka/rsql-parser#29, as i was looking for a library for a microservice ecosystem built on top of Spring Framework, with the ability to work with nested objects and complex query critera.

from springfilter.

torshid avatar torshid commented on May 24, 2024

Thanks again. :)
Feel free to open issues/ask for new features.

from springfilter.

torshid avatar torshid commented on May 24, 2024

By the way you are right, I just remembered that Postman does not encode by default as I had the same issue, this option can be turned on though.

from springfilter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.