I have an @Entity
. I want to make calculations on its fields.
The problem is that I need to use extra constant parameters for some calculations that came from a @Service
.
How should I handle this problem? Probably I shouldn't autowire a service into a model.
Another option is to make a service for the model to handle all the calculations and store results in the model. I don't like it, because recalculations are more problematic and formulas are not stored together with the model.
Any idea?