I have an entity in a JDL file.
entity Person {
Name String,
Duration Integer
}
The word 'Duration' is a data type in the Jhipster Domain Language. https://www.jhipster.tech/jdl/entities-fields
However, I need my entity to have this field name.
How can I have a field name 'Duration' be a valid field name? I have tried escaping it using double quotes, slashes, etc. but it's not working.
It underscores it red and says 'no viable alternative at input 'Duration''
The first problem is that the field names should be lowercase.
Try this:
I think the error which you are seeing is just visual feedback from the editor.
The application should still generate successfully, however it is preferable to stick to the standard naming conventions :