Closed vw98075 closed 1 year ago
In JDL,
enum Currency { USD("USD") }
The generated Java code will be
/** * The Currency enumeration. */ public enum Currency { USD; private final String value; Currency(String value) { this.value = value; } public String getValue() { return value; } }
The code isn't valid.
7.9.3
entityName.json
.jhipster
It seems appropriate to change the current code so that an enum is deemed to not have a custom value when its key equals its value:
https://github.com/jhipster/generator-jhipster/blob/06faa52ac18d70a6201cb8c444c63c5760ee8dc3/generators/base-application/support/enum.mjs#L22-L24
If there's no disagreement, I plan to submit a Pull Request for this.
Overview of the issue
In JDL,
The generated Java code will be
The code isn't valid.
Motivation for or Use Case
Reproduce the error
Related issues
Suggest a Fix
JHipster Version(s)
7.9.3
JHipster configuration
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System