随笔分类 -  hibernate

摘要:1:临时状态 new2: 持久化状态 save ,get,update3: 脱管状态 clear close, evict在操作了hibernate的方法如save()等后,并没有直接生成sql语句,去操作数据库,而是把这些更新存入Session中,只有Session缓存要被更新时,底层的sql... 阅读全文
posted @ 2015-05-11 19:02 BigShui 阅读(188) 评论(0) 推荐(0) 编辑
摘要:public class generator extends hibernateUtil { /* * increment机制是int 查找当前id的最大值加1,两次查询效率底点 * Hibernate: select max(id) from Person Hibernate: i... 阅读全文
posted @ 2015-05-11 18:57 BigShui 阅读(209) 评论(0) 推荐(0) 编辑
摘要:1:hibernate操作的帮助类public class hibernateUtil { public static SessionFactory factory; static{ Configuration cfg = new Configuration(); cfg.configure()... 阅读全文
posted @ 2015-05-11 18:48 BigShui 阅读(206) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示