
hibernate
tcl1360
这个作者很懒,什么都没留下…
展开
-
浅谈对象在Hibernate中的状态(转)
<br />Hibernate中的对象有三种状态: 瞬时状态(Transient),持久状态(Persistent),<br />1. 脱管状态(Detached)<br /><br />1. 1.瞬时状态(Transient)<br />由new命令开辟内存空间的Java对象,也就是平时所熟悉的普通Java对象。<br />如:Student stu = new Student();<br /> <br />瞬时对象特点:<br />(1)不和Session实例关联<br />(2)在数据库中没有和瞬时对转载 2011-04-27 14:46:00 · 284 阅读 · 0 评论 -
hibernate load 和 get 的一点区别
/** * Return the persistent instance of the given entity class with the given identifier, * assuming that the instance exists. This method might return a proxied instance that * is initia原创 2011-06-20 11:33:00 · 305 阅读 · 0 评论 -
hibernate Inverse和Cascade 实践
配置1: java : SCompany c = (SCompany) s.get(SCompany.class, new Long("22")); s.delete(c); s.beginTransaction().commit(); 结果1: 2011-06-20 12:25:14,562 [or原创 2011-06-20 12:45:00 · 353 阅读 · 0 评论