论坛首页 入门技术论坛

hibernate对对象分为3种状态:

浏览 2241 次
该帖已经被评为新手帖
作者 正文
   发表时间:2008-01-27  
hibernate对对象分为3种状态:
transient:自由状态、临时状态。 VO (Value Object)
persistent:持久状态,hibernate管理状态。 PO  (Persistenct Object)
detached:游离状态、脱钩状态、脱管状态。VO (Value Object)
 +-----------+    session.save    +----------+  session.close   +-----------+
 |           |------------------->|          |----------------->|           |
 | transient |                    |persistent|                  | detached  |
 |           |<-------------------|          |<-----------------|           |
 +-----------+   session.delete   +----------+  session.update  +-----------+
                                    ^      |                            
                                    |      |     
                               load/|      |tx.commit
                               get  |      |     
                                    |     \/      
                                  +==========+  
                                  |          |  
                                  | database |  
                                  |          |  
                                  +==========+ 
论坛首页 入门技术版

跳转论坛:
Global site tag (gtag.js) - Google Analytics