Note how the Validator
javadoc states
Validates bean instances. Implementations of this interface must be thread-safe.
As such a Validator
shouldn't really contain state, unless that state is also thread-safe. Therefore, you shouldn't need to create a new Validator
instance, just re-use the same one, depending on the types obviously.
As well, how expensive in terms of computation is it for me to instantiate a new validator each time I would like to use it?
This depends on your Validator
. But the instantiation (creating but not initializing the object) itself is almost completely negligible, especially when you consider all the processing that a JPA implementation performs.