Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 10844
- 자료구조
- pscp
- springboot
- C
- 여러인수
- 자바
- Spring
- @NotEmpty
- 전치행렬 #C
- @ModelAttribute
- 디자인패턴
- designpattern
- Linux
- @Spring
- gradle
- 쉬운 계단 수
- BubbleSorting
- 숫자야구
- 백준
- setParameter
- junit
- java
- 점세개
- mycp
- decorator
- createQuery
- 데코레이터패턴
- NamedParameterNotBound
- 10951
Archives
- Today
- Total
...
[Spring/JPA] javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotEmpty' validating type 'java.lang.Long'. 해결 본문
백엔드/JPA
[Spring/JPA] javax.validation.UnexpectedTypeException: HV000030: No validator could be found for constraint 'javax.validation.constraints.NotEmpty' validating type 'java.lang.Long'. 해결
gi2 2022. 6. 14. 14:09@NotNull @NotEmpty 차이
Integer 타입 위에는 -> @NotNull
String 타입 위에는 -> @NotEmpty
따라서
@Data
static class CreateStudyRequest {
@NotEmpty
private Long memberId;
@NotEmpty
private String title; //스터디제목
private String region; //지역
private String dayOfWeek; //요일
private String isOnline; //대면비대면여부
private String categories; //공부카테고리
private int personLimit; //인원제한
private String content; //소개줄글
private List<QuestionDTO> questions;
}
memberId 위에 @NotEmpty를 @NotNull로 변경해주면 오류가 해결됨
'백엔드 > JPA' 카테고리의 다른 글
다대다 안되는 이유 (0) | 2022.05.29 |
---|
Comments