jpa 쓸 때 cascade 말이야 my sql에서도 cascade 있잖아
근데 mysql에서 cascade 걸어놨는데 jpa에서도 cascade 걸어줘야함???
그냥 user만 지우면 1:n 관계 테이블 다 지워지게 mysql에 설정했는데
굳이 jpa에도 설정을 해야 되나 싶어서
jpa 쓸 때 cascade 말이야 my sql에서도 cascade 있잖아
근데 mysql에서 cascade 걸어놨는데 jpa에서도 cascade 걸어줘야함???
그냥 user만 지우면 1:n 관계 테이블 다 지워지게 mysql에 설정했는데
굳이 jpa에도 설정을 해야 되나 싶어서
kaskade turn it down
if you declare cascade in the database and hibernate the database will always delete first if it supports it and the hibernate calls will not really delete anything but run anyway. However, since you are using hibernate its main advantage is to allow easy transition to a new database which may not support database side cascade ability. Thus you would want to leave them in there even if your databa
정답 찾았당