본문 바로가기
🍃 𝗦𝗽𝗿𝗶𝗻𝗴 𝗕𝗼𝗼𝘁

[JPA] Could not instantiate id generator 'entity-name'

by 비타민찌 2022. 8. 26.
728x90

전체 에러 :

Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not instantiate id generator 'entity-name'

 

[엔티티 클래스]

@Getter
@SequenceGenerator(
        name = "member_id_seq",
        sequenceName = "idx_member"
)
@NoArgsConstructor
@Entity(name = "member")

 

'could not instantiate id generator .. ' 와 같은 에러가 발생했다면

다음과 같이 옵션에 allocationSize=1을 넣어주세요.

 

@Getter
@SequenceGenerator(
        name = "member_id_seq",
        sequenceName = "idx_member",
        allocationSize=1
)
@NoArgsConstructor
@Entity(name = "member")

 

해결!

728x90

댓글