org.hibernate.TransientObjectException: objectreferencesanunsavedtransientinstance-savethetransientinstancebeforeflushing: top.simba.bean.Courseatorg.hibernate.engine.internal.ForeignKeys.getEntityIdentifierIfNotUnsaved(ForeignKeys.java:279) atorg.hibernate.type.EntityType.getIdentifier(EntityType.java:455) atorg.hibernate.type.ManyToOneType.nullSafeSet(ManyToOneType.java:144) atorg.hibernate.persister.collection.AbstractCollectionPersister.writeElement(AbstractCollectionPersister.java:888) atorg.hibernate.persister.collection.AbstractCollectionPersister.recreate(AbstractCollectionPersister.java:1307) atorg.hibernate.action.internal.CollectionRecreateAction.execute(CollectionRecreateAction.java:50) atorg.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:560) atorg.hibernate.engine.spi.ActionQueue.executeActions(ActionQueue.java:434) atorg.hibernate.event.internal.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:337) atorg.hibernate.event.internal.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:39) atorg.hibernate.internal.SessionImpl.flush(SessionImpl.java:1282) atorg.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:465) atorg.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:2963) atorg.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2339) atorg.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:485) atorg.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:147) atorg.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$100(JdbcResourceLocalTransactionCoordinatorImpl.java:38) atorg.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:231) atorg.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:65) attop.simba.dao.HibernateMMDao.fn02(HibernateMMDao.java:97) atsun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethod) atsun.reflect.NativeMethodAccessorImpl.invoke(UnknownSource) atsun.reflect.DelegatingMethodAccessorImpl.invoke(UnknownSource) atjava.lang.reflect.Method.invoke(UnknownSource) atorg.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) atorg.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) atorg.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) atorg.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) atorg.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) atorg.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) atorg.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) atorg.junit.runners.ParentRunner$3.run(ParentRunner.java:290) atorg.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) atorg.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) atorg.junit.runners.ParentRunner.access$000(ParentRunner.java:58) atorg.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) atorg.junit.runners.ParentRunner.run(ParentRunner.java:363) atorg.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) atorg.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) atorg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459) atorg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675) atorg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382) atorg.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
解决方案:
求解!!!