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
- designpattern
- gradle
- @Spring
- Linux
- 자료구조
- mycp
- NamedParameterNotBound
- decorator
- 여러인수
- 자바
- springboot
- 10844
- @ModelAttribute
- @NotEmpty
- 디자인패턴
- Spring
- pscp
- C
- 전치행렬 #C
- java
- createQuery
- 숫자야구
- BubbleSorting
- 쉬운 계단 수
- 백준
- 10951
- setParameter
- 점세개
- 데코레이터패턴
- junit
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