Closed rjbgaspar closed 2 years ago
Thanks @rjbgaspar to report the issue. Are you available to contribute with a PR?
Adding a bug bounty since this is a bug
Hi @DanielFran,
Maybe in the future, at the moment I don't know the implementation of the generator and it would take quite some time to do it.
When I have the time and knowledge, I intend to give my contribution.
@DanielFran As I introduced this bug I can have a look to differentiate the id type and adapt the code.
Going to work on this later today, so we could have it in the next 7.9 release @DanielFran
Hello everyone,
Overview of the issue
Due to the fix for SQL Injection in Reactive project included with Release 7.8.1 (2022-04-07) where jhipster has replaced the Criteria with Condition in the EntityManager bean. E.g.
Prior to version 7.8.1
And now
the application will throw BadSqlGrammarException each time an entity is accessed by its ID.
Motivation for or Use Case
n.a.
Reproduce the error
Generate project with reactive with Spring WebFlux and set the database type to SQL
Related issues
SQL Injection in Reactive project
Suggest a Fix
We could generate ExampleRepositoryInternalImpl to wrap with single quote all entities with string type IDs, something like this:
Despite the idea, we cannot forget that whenever we use the Condition API to filter a string type, we have to wrap the field with single quotes.
JHipster Version(s)
7.8.1 (2022-04-07)
JHipster configuration
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL
Browsers and Operating System
n.a.