Inflearn brand logo image

Inflearn Community Q&A

seojeonghyeon0638467's profile image
seojeonghyeon0638467

asked

Developing Spring and JPA based web applications

Sign-up form submit validation

@Length, @Size

Written on

·

302

0

안녕하세요, 강사님!

제가 알기로는 @Length가 Hibernate에 종속적이어서 @Size가 더 가볍고 기능은 둘 다 동일하게 길이에 대한 유효성 검사를 하는 것으로 알고 있는데 혹시 @Length를 사용하는 추가적인 이유가 존재할까요..?

spring-bootjavathymeleafspringJPA

Answer 1

0

whiteship님의 프로필 이미지
whiteship
Instructor

네 말씀하신대로, @Size와 @Length 둘 중에 하나를 고르라면 @Size를 쓰는게 더 좋습니다. (저는 @Length를 썼었지만요.) 그게 조금 더 추상적인 API니까요.

seojeonghyeon0638467's profile image
seojeonghyeon0638467

asked

Ask a question