What is the best practice for solving the number of cases of N searches?
There are 3 search conditions for me. There are search conditions of A, B, and C.
In this case, the number of possible cases is Search only A, search only B, search only C, Search only AB, search only AC, search only BC Search only ABC
In the above situation, there are a total of 6 cases like this.(3!)
To map the number of all cases without thinking
@GetMapping("/A/{A}/B/{B}/C/{C}")
public ReturnType MethodName(@PathVariable AClass A
@PathVariable BClass B,
@PathVariable CClass C) {
return service.findByAandBandC(A, B, C);
I have to create 6 controller methods like the one above.
With 4 search conditions, need 24 methods (4! = 4 * 3 * 2)
If there are 5 search conditions, need 120 methods (5! = 5 * 4 * 3 * 2)
As above, it grows exponentially.
Instead of making all cases a method, I wonder if there is a best practice.
If possible, any answer utilizing spring data jpa would be appreciated.
best regards!
You may also like…
- Crashed: com.apple.main-thread partial apply for closure #2
- Merge Sorted Array without Extra Space
- Update Spring Embedded Entity throws Stack Overflow Entity
- How To Get Query Result and Count Of Result In SQL
- How to use artifactory query language inside a jenkins pipeline instead of having it call from a file
- Can't connect to Docker Hosted Postgres
- Is there a reliable alarm clock? Alarm Manager?
- Obj-c – Remove string from key in multiple dictionaries in array?
- should i use for loop or while loop to make a break timer in python?
- Get insights and post data from Facebook API
- how to display url taxonomy in loop taxonomy wordpress?
- How to unit test that my class listen to a stream and responds correctly in Dart
- Typescript determine nested object type from Union Type
- Flutter audioplayers seek when dragging not working on iOS Lock Screen
- Format output into an HTML file
- Remove entire main header of ag-grid column which has child columns
amazon-web-services android angular api arrays c# css dart dataframe django docker excel express firebase flutter html ios java javascript jquery json kotlin laravel linux list mongodb mysql node.js pandas php postgresql python python-3.x r react-native reactjs regex spring spring-boot sql sql-server string swift typescript vue.js