As part of entity definition, @Max(javax.validation.constraints.Max) won't take upper value to validate a 10 digit integer
@Min(0)
@Max(9999999999)
@Column(name = "some_column", nullable = false,
columnDefinition = "INT(10) NOT NULL")
private Integer someColumn;
Eclipse floats a red-mark at 2nd line with a message The value for annotation attribute Max.value must be a constant expression
.
I looked through to find the MAX_VALUE
for Integer
only to find it as 2147483647
which is 10 digit as well.
NOTE: hibernate-core:5.0.12
, validation-api:2.0.0.CR3
I modified the type to long wrapper
@Min(0)
@Max(9999999999)
@Column(name = "some_column", nullable = false,
columnDefinition = "INT(10) NOT NULL")
private Long someColumn;
But, still the error is being stubborn.