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
[ Springboot / JPA ] JPA composite key 사용할 때 @IdClass, Serializable
JPA Entity에서 복합키(composite key)를 사용할 떄 복합키에 해당하는 컬럼 모두에 @Id 을 달아주어야 한다. 그 뿐만 아니라 class에도 @IdClass(클래스명.class)를 달아주어야 한다. 이렇게만 선언해주고 실�
brocess.tistory.com
'WEB BANK-END > SPRING' 카테고리의 다른 글
nested exception is java.lang.NullPointerException 해결법 (0) | 2020.09.02 |
---|---|
[Hibernate] java.lang.ClassCastException : org.hibernate.internal.QueryImpl은 com.models.User로 캐스트 될 수 없습니다. 해결법 (0) | 2020.09.02 |
[Hibernate] JPA, Hibernate 차이점 (0) | 2020.09.01 |
[Hibernate] detached entity passed to persist: com.kopo.hibernateExample.model.SeoResvVO 해결법 (0) | 2020.09.01 |
[Spring] mvc 패턴 파라미터 받는 법 (0) | 2020.09.01 |