I would like to perform @Range based hibernate validation checks (org.hibernate.validator.RangeValidator) in my JPA entity code. But it seems to modify the generated SQL with this checks which I would like to avoid. (i.e In the range check, I have the current year as the @Range max value which is bound to change every year).
Hence, I had to remove this annotation from my JPA entity class. How would I be able to perform similar checks without adding the annotation? Should I do these checks in prePersist or preUpdate if so, how do I invoke the validators.
Appreciate any inputs on this topic