Hibernate commit method: commit transaction

翻译错误 Invalid Access Limit

Example

Session session = sessionFactory.openSession();  //定义Session对象
Transaction tx = session.beginTransaction();  //开启事务
UserForm uf = new UserForm();  //定义JavaBean对象
uf.setUsername(username);  //设置对象属性
uf.setPwd(pwd);
session.saveOrUpdate(uf);  //调用保存对象方法
tx.commit();  //提交事务
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>