JPA 디버깅 노트_autoincrease

Kim jisu·2024년 11월 7일
0

 Debugging Note

목록 보기
3/37

오류 발생일 : 2024.11.07

오류 로그 :

2024-11-07T23:34:59.973+09:00 DEBUG 25192 --- [blueprint] [pool-2-thread-1] org.hibernate.SQL                        : 
    select
        next_val as id_val 
    from
        member.real_estate_price_SEQ for update
2024-11-07T23:35:00.372+09:00 ERROR 25192 --- [blueprint] [pool-2-thread-1] o.hibernate.id.enhanced.TableStructure   : could not read a hi value

java.sql.SQLSyntaxErrorException: Table 'member.real_estate_price_SEQ' doesn't exist

원인:

Hibernate의 시퀀스 테이블(member.real_estate_price_SEQ)이 없어 ID 생성 시 오류가 발생함.

해결 방법:

해당 엔티티에 아래의 어노테이션을 추가하여 ID 생성을 기본 키 전략으로 변경

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
Entitiy에 위 코드 추가로 해결

profile
Dreamer

0개의 댓글