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

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

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

    Inheritance strategy

    There are three kinds of basic strategies for inheritence mapping:
    1. table per hierarchy.
    2. table per subclass.
    3. table per concreteclass.

    Table structure maybe the root reason to determine which kind strategy will be used.

    Table per hierarchy:
    With subclass element.
    A discriminator column will be used to distinguish subclass.
    Limitation: no not null constraint on sub class's property.
    Fault: redandance data will be generated.

    Table per subclass:
    With joined-class elment.
    There are tables for super class and each subclass, for every subclass, key elemnt is used to referenced to super class's primary key, and all common properties will be stored in super table. The relation between super table and sub table is one-to-one.
    Fault: complex table structure.


    Table per concrete class:
    With union-class elemnt.
    Super class responsible for genrate id and all common properties wich will stored in sub table.
    Fault: redandance data will be generated.
    Limitation: all common column should used the same column name for the properties are defined in super class.

    posted @ 2007-06-01 10:55 Sheldon Sun 閱讀(255) | 評論 (0)編輯 收藏

    HbmBinder

    Walks an XML mapping document and produces the Hibernate configuration-time metamodel (the classes in the mapping package)


     

    1. parse "extend" attribute of subclass, unionclass, joinedclass which defined under <hibernate-mapping> element.

    2. parse "meta" data element.

    3. parse other subclass of root element.

    posted @ 2007-05-30 12:57 Sheldon Sun 閱讀(153) | 評論 (0)編輯 收藏

    Hibernate filter

    1. Hibernate filter is used to give a definition condition in xml mapping files.
    2. Ever session want to use it must enable the filter with name first.
    3. filter is defined in xml with elment <filter-def> under <hibernate-mapping>, used <filter> element under <class> element.
    4. give certain sql condition attribute either in <filter-def> or <filter>.
    5. Support value to filter parameters in application.



    The main purpose is to support global filter.

    posted @ 2007-05-24 13:20 Sheldon Sun 閱讀(436) | 評論 (0)編輯 收藏

    Hibernate query

    1. session.createSqlQuery(), in purpose to increase performance, execute sql directly. addScalar() method is used to sepcify type of columns, add entity to return certain entity instance.
    2. session.getNamedQuery(), execute query defined in mapping files with <sql-query> element, the query can be a defined sql sentence or a procedure, property type and entity type can also be specifid by certain elment.
    3. update, detelet, insert sql can be defined in xml mapping files also.


    The finaly purpose of the query is to enchance performance.

    posted @ 2007-05-24 12:51 Sheldon Sun 閱讀(333) | 評論 (0)編輯 收藏

    Hibernate Criteria

    1. Usage org.hibernage.Criteria interface is to compose criterians included in org.hibernate.criteria package.
    2. Criteria interface inherit org.hibernate.criteria.CriterianSpecification, which only defined some mode value, e.g: flushmode, cach mode, maybe not a good implemnt.
    3. Criterian was implemnt by org.hibernate.impl.criteriaImpl and created by org.hibernate.impl.SessionImplementor, translate class name and sesson to criterian.
    4. Typical usage: session.createCriteria(class).add(Restriction.xx()).list;
    5. Restriction is factory of org.hibernate.criteria.Criteriaon implementation.

    Architecture : Define top level interface to compose low lever sub interface, easy to extense and maintain.

    posted @ 2007-05-24 10:55 Sheldon Sun 閱讀(277) | 評論 (0)編輯 收藏

    Hibernate - Environment

    There are 2 kinds of factory : factory level and System level, factory responsible for every factory instance, System for all facotrys, (only 2 system factory property).
    Evironment got properties for /hibernate.properties first, and then from System.getProperties() to ovrride old one!

    Totally, Evironment represents properties.

    posted @ 2007-05-22 13:57 Sheldon Sun 閱讀(111) | 評論 (0)編輯 收藏

    Collection mappings

    1. Use interface type.
    2. Ordered type collection has index sub-element.
    3. Key element indicates the foreign key referred to entity own the collection.
    4. "element" or "composite element" element is used to specify value type contained in collection.
    5. "many-to-many" or "one-to-many" elmeent is used to sepcify referred type contained in collection.
    6. one-to-many need not an intervening table.(foreign key)

    posted @ 2007-05-22 11:12 Sheldon Sun 閱讀(111) | 評論 (0)編輯 收藏

    Persisitent object

    Hard requirenment:
    1. No-argument construct , package visiblity, usde instantiate object by Constructor.newInstance().

    Option requirement:
    1. Pojo.
    2. Implement hashCode and equals for two resons :
        1) Object will be store in a set property.
        2) Instance span to sesssion scope, make a detached object persistent again, will call equals, for java indentify(==) and db indentify(pk) is not available for the condition(object doest not have identify before persistent),

    Note: hashCode generation should not use indentify proeprty  of object.

    posted @ 2007-05-17 08:51 Sheldon Sun 閱讀(240) | 評論 (0)編輯 收藏

    Hibernate configuration

    Hibernate configuration object is the core and starttime class , initiate it and call its config() method to initial sessionFactory.
    Configuration get properties, mapping , etc information through two ways:
    1. Config file: hibernate.propeties, system, hibernate.cfg.xml(optional, name changed Configuration.doConfig(*.cfg.xml)).
    2. Method: Configuration.addSource, addProperties...

    So config files is only a way of configuration to get config info.



    posted @ 2007-05-16 15:00 Sheldon Sun 閱讀(232) | 評論 (0)編輯 收藏

    0516_2

    Configuration: the class instantiate a sessionng factory, it works as follow:
    1. Get properties for Enviroment.java. Environment get properties from hibernate.properties and System, System propertie is prior to hibernate.properties when name is equal.
    2. Configuration.config will read hibernate.cfg.xml to get more properties and mapping files.


    During last two steps, it will some util class in org.hibernate.util to help handle file.

    3. Generate ConnectionProvider by its all properties.


    posted @ 2007-05-16 09:17 Sheldon Sun 閱讀(122) | 評論 (0)編輯 收藏

    僅列出標題
    共5頁: 上一頁 1 2 3 4 5 下一頁 
    <2025年5月>
    27282930123
    45678910
    11121314151617
    18192021222324
    25262728293031
    1234567

    導航

    統(tǒng)計

    常用鏈接

    留言簿(3)

    隨筆檔案

    文章檔案

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲综合视频在线观看| 91免费国产视频| 亚洲av无码国产精品色午夜字幕| 在线精品免费视频无码的| 久久国产乱子免费精品| v片免费在线观看| 亚洲色丰满少妇高潮18p| 无码久久精品国产亚洲Av影片| 亚洲高清视频一视频二视频三| 野花高清在线观看免费3中文| 香港a毛片免费观看| 一区二区三区免费精品视频| 亚洲av成人一区二区三区在线播放 | 欧美三级在线电影免费| 91精品全国免费观看含羞草 | 成人亚洲网站www在线观看| 99视频在线精品免费观看6| 1a级毛片免费观看| 无码国产精品一区二区免费模式| 三年片免费观看大全国语| 黄网站在线播放视频免费观看| 亚洲成AV人片高潮喷水| 亚洲国产成人99精品激情在线| 亚洲精品免费在线| 亚洲一区中文字幕久久| 亚洲天天做日日做天天欢毛片| 亚洲色偷偷偷鲁综合| 色久悠悠婷婷综合在线亚洲| 亚洲福利在线播放| 久久久久亚洲精品中文字幕| 亚洲成av人片一区二区三区| www国产亚洲精品久久久日本| 国产大片免费观看中文字幕| 日本一道本高清免费| 国产网站在线免费观看| 国产一级淫片a免费播放口之| 国产成人在线观看免费网站| 国产一级淫片a免费播放口之| 国产免费一区二区三区VR| 日韩亚洲国产综合久久久| 国产啪亚洲国产精品无码 |