Hibernate: insert into news_table (title, content) values (?, ?)
Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not insert: [org.crazyit.app.domain.News]
…………此处省略
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'hibernate.news_table' doesn't exist
…………此处省略
方言的设定,跟数据库的版本是有关系的。(我使用的5)
如果MySql数据库engine=InnoDB,即本身支持事务。那么,hibernate设定的时候就无需再指定了。
如果指定,就会发生错误。
如果Mysql数据库的设定是不支持事务的话,那么指定方言:MySQL5InnoDBDialect(默认mySQLInnoDBDialect)
hibernate就会自动创建支持事务的表。