본문 바로가기

WEB BANK-END/SPRING

[Hibernate] 복합 ID 클래스가 Serializable을 구현해야하는 이유

stackoverflow.com/questions/9271835/why-composite-id-class-must-implement-serializable

 

Why composite-id class must implement Serializable?

If I make a composite-id class which doesn't implement Serializable like: @Entity @Table(name = "board") public class Board { @Id @Column(name = "keyword_news_id") private int id; ...

stackoverflow.com

brocess.tistory.com/237

 

[ Springboot / JPA ] JPA composite key 사용할 때 @IdClass, Serializable

JPA Entity에서 복합키(composite key)를 사용할 떄 복합키에 해당하는 컬럼 모두에 @Id 을 달아주어야 한다. 그 뿐만 아니라 class에도 @IdClass(클래스명.class)를 달아주어야 한다. 이렇게만 선언해주고 실�

brocess.tistory.com