Hibernate4 中已經(jīng)沒有HibernateDaoSupport了,所以DAO層按視頻上寫會(huì)有異常,可以這樣試試:
public void save(Product product){
Session session = this.getSessionFactory().openSession();
Transaction tx = session.beginTransaction();
session.save(product);
tx.commit();
session.close();
public void save(Product product){
Session session = this.getSessionFactory().openSession();
Transaction tx = session.beginTransaction();
session.save(product);
tx.commit();
session.close();
2017-02-24
慕課網(wǎng)加載進(jìn)度條的這個(gè)方式真是蛋疼,非要看到哪里加載到哪里,一直加載完不好嗎,網(wǎng)速差的體驗(yàn)很不好啊。
2017-02-23
有沒有老哥出現(xiàn)這個(gè)錯(cuò)誤
嚴(yán)重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
嚴(yán)重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext
2017-02-22
最新回答 / qq_小藝軒_03563899
源代碼網(wǎng)上很多,JAR包可以去Apache官網(wǎng)下載
創(chuàng)建事務(wù)時(shí),<tx:advice >這個(gè)貌似用一些吧。
2017-02-17
最新回答 / 慕粉3763154
找到問題了吧?<prop?key="hibernate.hdm2ddl.auto">update</prop>寫錯(cuò)了?<prop?key="hibernate.hbm2ddl.auto">update</prop>
2017-02-14