摘要: MyEclipse 中用Hibernate自动生成的DAO默认不能对数据库做任何修改操作,只能读,解决方法是:1:在hibernate.cfg.xml中添加<session-factory>…… <property name="connection.autocommit">true</property>……</session-factory>然后在DAO的save,delete方法中在添加flush就行了。getSession().save(transientInstance);getSession().flush();2:直 阅读全文
posted @ 2012-05-23 18:29 SmartDog 阅读(1217) 评论(0) 推荐(0) 编辑