본문 바로가기
JAVA

JSR303 HV000030 Error

by 아이티.파머 2016. 10. 19.
반응형

No validator could be found for constraint 'javax.validation.constraints.Size' validating type 'java.lang.Integer'

 

wrapper Type 의 경우 @NotNull 을 사용 하여야 한다.  Null이 올수 있기 때문이다.

이데 @Size와 혼용이 안되고 HV.... Error

@Size를 민 맥스로 봤는데, 케릭터셋이나 Connection, Array 객체의 사이즈였다.

 

 

@Mix, Max 를 이용하여 처리한다.

 

 

javax.validation.constraints.Size

 

The annotated element size must be between the specified boundaries (included).

Supported types are:

  • CharSequence (length of character sequence is evaluated)
  • Collection (collection size is evaluated)
  • Map (map size is evaluated)
  • Array (array length is evaluated)

null elements are considered valid.

Author:Emmanuel Bernard

 

 

javax.validation.constraints.Max

 

@Constraint(validatedBy={})
@Target(value={ANNOTATION_TYPE, CONSTRUCTOR, FIELD, METHOD, PARAMETER})
@Retention(value=RUNTIME)
@Documented

The annotated element must be a number whose value must be lower or equal to the specified maximum.

Supported types are:

  • BigDecimal
  • BigInteger
  • byte, short, int, long, and their respective wrappers

Note that double and float are not supported due to rounding errors (some providers might provide some approximative support).

null elements are considered valid.

Author:Emmanuel Bernard

반응형