近日在项目中遇到以下错误,着实郁闷了一把: org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing:com.dhcc.itsm.base.model.User. 这主要是在ManyToOne时遇到的,百度之,发现原因如下: new了一个新对象,在未保存之前将它保存进了一个新new的对象(…