<bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory"><ref bean="sessionFactory"/> </property> </bean> <tx:advice id="txAdvice" transaction-manager="transactionManag
用的hibernate4 为什么添加数据成功 但是为空?SQL也显示出来了 private SessionFactory sessionFactory; public void save(Product product){ Session session = this.getSessionFactory().openSession(); Transaction tx = session.beginTransaction(); session.save(product); tx.commit(); session.close(); }