devonfw / cobigen

Code-based Incremental Generator
Apache License 2.0
35 stars 70 forks source link

Implement version of crud_java_server_app devon4j template with SearchConfig support for Comparable types #1612

Closed smangel-cg closed 1 year ago

smangel-cg commented 1 year ago

As an application developer using CobiGen together with a devon4j stack in by backend, I want to be able to generate repository classes that dynamically handle SearchConfigs for types other than String so that I can avoid writing a lot of duplicated code manually.

As of now, any other datatype than String does not come with a SearchConfig object, which would allow to dynamically handle operators. However, this would be beneficial, as using different operators for Comparable types, such as dates and numbers, is an arguably common usecase.

For this, the repository template, as well as the search criteria template of the crud_java_server_app template group should be extended to support search configs for Comparable types. To this end, an extension or creation of a util class may also be necessary.

This issue is closely coupled with #579 of devon4j.

NOTE: I am currently working on a PR for this issue after discussing it with @SchettlerKoehler and @maybeec.