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