object references an unsaved transient instance - save the transient instance before flushing:
object references an unsaved transient instance - save the transient instance before flushing: 报错原因报错原因在级联操作时 , 新建了一个对象 , 在未保存之前将它保存到了另一个新建的对象中( 非持久态 )解决办法@ManyToMany中添加cascade属性,值为PERSIST...