Closed aricooperman closed 1 year ago
After some investigations, Jhipster uses Spring Data Specifications and JpaSpecificationExecutor for filtering in non-reactive mode, not yet supported in reactive mode, as indicated here. Some notes to reproduce the error manually with generator:
jhipster entity myentity
It should be possible to filter manually for now, will check this.
After some deeper investigations, I seems possible to do filtering by using Query By Example r2dbc feature. An example can be seen here. However, this feature requires Spring Boot 2.5.0-RC1., not yet released, and so not part of Jhipster for now. But I think it is possible to start working on this feature, and release it when Spring Boot 2.5.0 will be integrated into JHipster. Any remark or suggestion are welcome!
This issue is stale because it has been open 30 days with no activity. Our core developers tend to be more verbose on denying. If there is no negative comment, possibly this feature will be accepted. We are accepting PRs :smiley:. Comment or this will be closed in 7 days
Please go for it @smaestri !
@smaestri Can you confirm you are still available to contribute with a PR?
Hi, yes I have some free time to work on it in the next weeks. I Keep you posted
Full disclosure - I am new to this Reactive & Criteria part
Just out of curiosity, why not use the existing org.springframework.data.relational.core.sql. or org.springframework.data.relational.core.query. to implement this feature.
Based on this issue - referenced by @smaestri spring R2DBC does not support relationship, so why bring in Query By Example.
I feel that the existing EntityCriteria implementation can be reused and the org.springframework.data.relational.core.sql.Condition part could be built based on the search-criteria enabling the filtering option (I am hoping that the Condition/Criteria would support all the existing non-reactive filtering options - I can do some investigation if you guys think its an acceptable approach)
Did a little reading and found the following (reference), "Query by Example also has several limitations: No support for nested or grouped property constraints, such as firstname = ?0 or (firstname = ?1 and lastname = ?2). Only supports starts/contains/ends/regex matching for strings and exact matching for other property types."
Based on my previous comment, here is a sample gateway application with two entities (Customer & Address) implementing entity filtering, everything is supported except,
All the tests (unit & e2e) have passed.
Here are the list of files changed for this feature.
If you guys like this approach, i can build this feature into the generator.
@smaestri @mraible @DanielFran, what do you guys think about this implementation, is it good enough for the generator. I can make the ConditionBuilder more generic. Things that need you comments,
bug bounty claim https://opencollective.com/generator-jhipster/expenses/160398
Overview of the issue
If you select reactive = true and also try to enable filtering on any entities, those entities will not have any filtering code generated for them, or at least the API does not support it
Motivation for or Use Case
If you want to have entity filtering and reactive at same time
Reproduce the error
Enable filtering on any entity and turn reactive on
Related issues
None seen
Suggest a Fix
Unsure
JHipster Version(s)
7.0.1
JHipster configuration
JDL to quickly reproduce, Just toggle reactive on and off and check resulting generation
JDL definitions
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryGenerated from JDL above
Browsers and Operating System
Should not be browser or platform related but testing on Fedora 33