Let's say I am having inheritance in my entities like: Animal - parent Childs: Cat, Dog
I would like to use DTOs in my service layer and I wonder how can I represent the inheritance above as DTO? For example, I had a method like this in the service before using DTO: Animal add(Animal animal). I would like to be something like this: AnimalDTO add(AnimalDTO team)
CodePudding user response:
That is perfectly possible, just do it as you did for the entities.