<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

    Modifying persistent objects

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

    Transactional persistent instances (ie. objects loaded, saved, created or queried by the Session) may be manipulated by the application and any changes to persistent state will be persisted when the Session is flushed (discussed later in this chapter). There is no need to call a particular method (like update(), which has a different purpose) to make your modifications persistent. So the most straightforward way to update the state of an object is to load() it, and then manipulate it directly, while the Session is open:

    DomesticCat cat = (DomesticCat) sess.load( Cat.class, new Long(69) );
    cat.setName("PK");
    sess.flush();  // changes to cat are automatically detected and persisted

    Sometimes this programming model is inefficient since it would require both an SQL SELECT (to load an object) and an SQL UPDATE (to persist its updated state) in the same session. Therefore Hibernate offers an alternate approach, using detached instances.

    Note that Hibernate does not offer its own API for direct execution of UPDATE or DELETE statements. Hibernate is a state management service, you don't have to think in statements to use it. JDBC is a perfect API for executing SQL statements, you can get a JDBC Connection at any time by calling session.connection(). Furthermore, the notion of mass operations conflicts with object/relational mapping for online transaction processing-oriented applications. Future versions of Hibernate may however provide special mass operation functions. See Chapter 13, Batch processing for some possible batch operation tricks.


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


    網站導航:
     
    主站蜘蛛池模板: 91国内免费在线视频| 日韩成人毛片高清视频免费看| 另类免费视频一区二区在线观看| 亚洲国产精品自在拍在线播放| 99亚洲乱人伦aⅴ精品| 手机看片久久国产免费| 亚洲精品人成网线在线播放va| 免费看的黄色大片| 亚洲AV无码资源在线观看| 成人免费视频国产| 免费激情网站国产高清第一页| 亚洲精品成人久久久| 成在线人视频免费视频| 久久精品亚洲一区二区| 57pao国产成视频免费播放 | 亚洲av网址在线观看| 免费人成视频在线观看网站| 亚洲伊人久久大香线蕉啊 | 人人狠狠综合久久亚洲高清| 曰批全过程免费视频免费看 | 中文字幕亚洲免费无线观看日本| 久久久无码精品亚洲日韩蜜臀浪潮| xxxxwww免费| 国产精品亚洲专区无码唯爱网 | 可以免费观看的一级毛片| 一级成人a免费视频| 亚洲资源在线观看| 成人男女网18免费视频| 一本一道dvd在线观看免费视频| 亚洲AV午夜成人片| 一个人免费观看在线视频www| 国产精品亚洲а∨天堂2021| 亚洲精品乱码久久久久久按摩| 亚洲精品视频在线免费| 羞羞视频免费网站含羞草| 亚洲成A∨人片在线观看不卡| 国内精品免费麻豆网站91麻豆 | 91在线亚洲精品专区| 国产免费69成人精品视频| 精品亚洲永久免费精品 | 亚洲人成人网站18禁|