用eclipse自动生成时,hibernate.cfg.xml要加一句 <property name="connection.autocommit">true</property> 否则会无法提交到数据库,而且还不报错