<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Neil的備忘錄

    just do it
    posts - 66, comments - 8, trackbacks - 0, articles - 0

    Working with objects

    Posted on 2008-11-01 10:01 Neil's NoteBook 閱讀(58) 評論(0)  編輯  收藏

    Working With Objects

    Hibernate is a full object/relational mapping solution that not only shields the developer from the details of the underlying database management system, but also offers state management of objects. This is, contrary to the management of SQL statements in common JDBC/SQL persistence layers, a very natural object-oriented view of persistence in Java applications.

    In other words, Hibernate application developers should always think about the state of their objects, and not necessarily about the execution of SQL statements. This part is taken care of by Hibernate and is only relevant for the application developer when tuning the performance of the system.

    Hibernate object states

    Hibernate defines and supports the following object states:

    • Transient - an object is transient if it has just been instantiated using the new operator, and it is not associated with a Hibernate Session. It has no persistent representation in the database and no identifier value has been assigned. Transient instances will be destroyed by the garbage collector if the application doesn't hold a reference anymore. Use the Hibernate Session to make an object persistent (and let Hibernate take care of the SQL statements that need to be executed for this transition).

    • Persistent - a persistent instance has a representation in the database and an identifier value. It might just have been saved or loaded, however, it is by definition in the scope of a Session. Hibernate will detect any changes made to an object in persistent state and synchronize the state with the database when the unit of work completes. Developers don't execute manual UPDATE statements, or DELETE statements when an object should be made transient.

    • Detached - a detached instance is an object that has been persistent, but its Session has been closed. The reference to the object is still valid, of course, and the detached instance might even be modified in this state. A detached instance can be reattached to a new Session at a later point in time, making it (and all the modifications) persistent again. This feature enables a programming model for long running units of work that require user think-time. We call them application transactions, i.e. a unit of work from the point of view of the user.

    We'll now discuss the states and state transitions (and the Hibernate methods that trigger a transition) in more detail. 





    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 日韩在线不卡免费视频一区| 成人午夜18免费看| 亚洲av片不卡无码久久| 国产午夜无码视频免费网站| 中文字幕看片在线a免费| 亚洲国产精品综合久久久| 亚洲成av人在片观看| 7x7x7x免费在线观看| 色婷婷综合缴情综免费观看| 中文字幕亚洲精品| 亚洲精品tv久久久久| 免费影院未满十八勿进网站| 免费国产黄网站在线看| 亚洲av专区无码观看精品天堂| 中文字幕第13亚洲另类| 啦啦啦在线免费视频| 99久久国产免费-99久久国产免费 99久久国产免费中文无字幕 | 国产又黄又爽胸又大免费视频| 亚洲国产成人资源在线软件| 中文字幕精品无码亚洲字| 女人毛片a级大学毛片免费| 久久成人免费大片| 一级毛片试看60分钟免费播放| 亚洲国产成a人v在线观看| 少妇人妻偷人精品免费视频| 日韩成全视频观看免费观看高清| aa毛片免费全部播放完整| 亚洲AV成人一区二区三区在线看| 亚洲精品夜夜夜妓女网| 四虎AV永久在线精品免费观看| 最好看最新的中文字幕免费| xxxxx做受大片在线观看免费| 亚洲中文字幕久久久一区| 亚洲伊人久久大香线蕉苏妲己| 国产精品xxxx国产喷水亚洲国产精品无码久久一区 | 国产日韩在线视频免费播放| 亚洲 日韩 色 图网站| 亚洲小视频在线观看| 中文字幕不卡亚洲| 亚洲精品视频免费观看| 日本一道一区二区免费看|