hibernate

来源:互联网 发布:mysql百度云 编辑:程序博客网 时间:2024/05/16 09:46

Enabling the SQL output to stdout is only your first logging option. Hibernate(and many other ORM implementations) execute SQL statements asynchronously.An INSERT statement isn’t usually executed when the application callssession.save(), nor is an UPDATE immediately issued when the applicationcalls item.setPrice(). Instead, the SQL statements are usually issued at the endof a transaction.大概意思是:

输出sql语句只是日志的事情。Hibernate(和一些的其他的ormg工具)并不是立即执行sql语句。一个插入语句不是在你的程序代码里执行了session.save();就是立马执行的,更新也是一样当改变了持久化对象的数据不会立马执行update语句的,而是在事务结束的时候才会执行的。

原创粉丝点击