只要是表關係的註解都有這個value--cascade。包括@OneToOne,@ManyToMany,@OneToMany…….
cascade的中文翻譯叫集聯,主要的作用是更改一張表時會更改與他有聯繫的那一張或幾張表。
cascade的值類型時Enum的。
ALL :Cascade all operations
DETACH :Cascade detach operation
MERGE :Cascade merge operation
merge=save+update
PERSIST: Cascade persist operation
REFRESH: Cascade refresh operation
refresh=A裏面需要讀B改過之後的數據
REMOVE:Cascade remove operation