We use Data Transfer Objects (DTO) in our code. When constructing them, it is inevitable that some of their fields will have null values as some of those fields are null in the database. We were told that all null values must be default to "NA".
I know we can implements this the "hard way" by putting logic in the get methods of the DTOs. Question is, is there a better way to do this? I tried using @Value annotation of Spring to set its default values but this does not work.
Can anyone help? Thank you.