Search code examples
hibernatehibernate-validator

Is there a way to set the validation condition to "strictly greater than"?


I would like to know instead of the Hibernate validator @Min which is inclusive (equal or greater than) is there a way to express "strictly greater than" a number?

Thanks very much :)


Solution

  • Not with the built-in constraints. You would need a custom constraints. But if you are dealing with integers you can always use @Min with your limit + 1.