관리 메뉴

제뉴어리의 모든것

[SP Boot]Caused by: java.lang.IllegalStateException: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing : org.zerock.board.entity.Board.writer -> org.zerock.board... 본문

BugNote

[SP Boot]Caused by: java.lang.IllegalStateException: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing : org.zerock.board.entity.Board.writer -> org.zerock.board...

제뉴어리맨 2021. 1. 20. 21:31

Intellij 콘솔 에러 메세지

Caused by: java.lang.IllegalStateException: org.hibernate.TransientPropertyValueException: object references an unsaved transient instance - save the transient instance before flushing : org.zerock.board.entity.Board.writer -> org.zerock.board.entity.Member

 

원인 : "Member" 테이블의 특정 필드가 "Board" 테이블과 외부키(FK)로 연결되어 있는데 "Board" 테이블을 만들때 값을 넣고 save 하려고 하니 "Board" 테이블의 값과 매칭 되는 FK 값이 "Member"에 존재하지 않아서