<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)

    隨筆檔案

    文章檔案

    搜索

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 特级毛片在线大全免费播放| 亚洲高清资源在线观看| 亚洲av无码专区在线电影天堂 | 性一交一乱一视频免费看| 亚洲精品456在线播放| 桃子视频在线观看高清免费视频| 久久精品亚洲综合专区| 青青草原1769久久免费播放| 亚洲五月激情综合图片区| 24小时日本韩国高清免费| 亚洲剧情在线观看| 蜜桃精品免费久久久久影院| 婷婷亚洲综合一区二区| 亚洲色偷拍区另类无码专区| 大地资源网高清在线观看免费 | 国产精品免费大片| 久久亚洲精品无码VA大香大香| 亚洲成人免费网址| 亚洲老熟女五十路老熟女bbw| 免费视频中文字幕| 精品国产免费人成网站| 亚洲福利视频一区| 成人毛片免费观看视频大全| 水蜜桃视频在线观看免费| 亚洲香蕉成人AV网站在线观看| 十八禁在线观看视频播放免费| 亚洲日本国产精华液| 国产精品冒白浆免费视频| 免费看搞黄视频网站| 亚洲中文字幕在线无码一区二区| 日本特黄a级高清免费大片| 中文字幕无线码免费人妻| 亚洲精品成人网站在线播放| 免费爱爱的视频太爽了| baoyu116.永久免费视频| 亚洲人6666成人观看| 亚洲日本中文字幕天堂网| 亚洲精品视频免费在线观看| 视频一区在线免费观看| 亚洲视频小说图片| 亚洲无线一二三四区手机|