object references an unsaved transient instance - save the transient instance before flushing:

mac2022-06-30  30

object references an unsaved transient instance - save the transient instance before flushing:

报错原因

报错原因

在级联操作时 , 新建了一个对象 , 在未保存之前将它保存到了另一个新建的对象中( 非持久态 ) 解决办法@ManyToMany中添加cascade属性,值为PERSIST

最新回复(0)