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 | 31 |
Tags
- 백준 섬의갯수
- html error
- baekjoon 3187
- backjoon 16173
- 백준 2667 java
- 안전영역 java
- 단지 번호붙이기
- beakjoon
- exprectedbelow
- springboot
- BFS
- baekjoon 16953
- bytebuddyinterceptor
- Error
- baekjoon 2667
- beakjoon 1697
- dfs
- baekjoon 4963
- spring boot
- beakjoon11725
- 백준 현수막
- websecurityconfiguration
- baekjoon 2468
- java.lang.nosuchmethoderror
- CodingTest
- attvalue
- baekjoon1012
- coding test
- baekjoon
- baekjoon 14714
Archives
- Today
- Total
NOT FOUND
Spring boot test h2 예약어 문제 / JPA 예약어 필드 사용 방법 본문
테스트 코드 작성 중 "month"가 예약어여서 아래 에러가 났다.
could not prepare statement [Syntax error in SQL statement "select ge1_0.id,ge1_0.completed,ge1_0.completed_at,ge1_0.created_at,ge1_0.due_date,ge1_0.[*]month,ge1_0.group_id,ge1_0.title,ge1_0.updated_at,ge1_0.user_id,sg1_0.goal_id,sg1_0.id,sg1_0.completed,sg1_0.completed_changed_at,sg1_0.created_at,sg1_0.importance,sg1_0.title,sg1_0.updated_at,sg1_0.user_id from goals ge1_0 left join sub_goals sg1_0 on ge1_0.id=sg1_0.goal_id and sg1_0.is_deleted=false where ge1_0.is_deleted=false and ge1_0.id=?"; expected "identifier"; SQL statement: select ge1_0.id,ge1_0.completed,ge1_0.completed_at,ge1_0.crea...
h2 디비 예약어인건데, 테스트코드때문에 필드명을 바꿀 순 없는 노릇.
jpa:
properties:
hibernate:
auto_quote_keyword: true
위와 같이 yml 파일에 추가해주면 예약어에 자동으로 백틱을 붙여 사용 가능하게 해준다.