I'm using java and I have the following scenario.
The entity season one of the attributes is duration and a season can have many chapters, for each chapter that is added to a season, the duration of all the chapters is added and added to the season.
I am doing the following:
res.getTemporada().setDuracion(res.getTemporada().getDuracion() + res.getDuracion());
To the duration of the season:
res.getTemporada().getDuracion()
I add the duration that I bring from the view of the new chapter, but the sum in this conventional way does not work
res.getDuracion()
The duration is of the Time type