I am trying to generate code using Jhipster. Below is my JDL and it contains entity to generate JPA entity and also DTO. DTO is generated based on the given entity. Here is my problem. I need some extra fields in DTO but those are not required in generated entity class.
Basically I can achieve this in two way
Edit generated DTO class and add required attributes
Extend the generated DTO and add required new attributes.
Do we have any other way to achieve this ? like using some annotation I can say this attribute needed only in DTO and it is not required in Entity. Editing generated code is not allowed in the project so cannot use that approach.
@service(serviceImpl)
@dto(mapstruct)
entity EmployeeMaster(empl_mst){
empNumber Long required
empName String required
age Integer required
gender String required
effectiveFromDate LocalDate required
effectiveToDate LocalDate required
department String required
}