@Entity
@Getter
@Setter
@NoArgsConstructor
public class User extends BaseEntity{
이와 같이 User클래스를 h2에 테이블을 만들려고 할떄
o.h.t.s.i.ExceptionHandlerLoggedImpl : GenerationTarget encountered exception accepting command : Error executing DDLcreate table user 이와 같은 에러가 나타난다.
구글링을 해보니 user라는 이름이 h2에서 예약어 일수 있다고 한다.
@Entity
@Getter
@Setter
@Table(name = "\"User\"")
@NoArgsConstructor
public class User extends BaseEntity
이런식으로 백슬래시(\)를 사용하여 이스케이프 처리를 해주면 테이블 생성이 잘된다.
'Spring Boot' 카테고리의 다른 글
[spring] 스프링 부트에서 Email 보내기 구현 (0) | 2022.08.08 |
---|---|
[spring] Spring Mail AuthenticationFailedException 해결 (0) | 2022.05.08 |
[spring] 위도 경도를 받아서 Point형으로 db에 저장하기(Mysql 위치데이터) (0) | 2022.03.20 |
spring boot 어노테이션 정리 (0) | 2022.01.02 |
스프링 기초 적어보기 (0) | 2021.12.23 |