VIRGIN FOREST OF JAVA
不要埋头苦干,要学习,学习,再学习。。。。。
powered by R.Zeus
in class Configuration ,there is many properties to init.see how hibernate deal with all the properties.it use class Mappings to include all the proterties which had a constructor needed all the proterties.as we know,Configuration deal with the hibernate.cfg.xml and HbmBinder with the *.hbm.xml,but all the properties are stored in Configuration then used to build
SessionFactory.How Configuration get the properties analyzed in HbmBinder .The bridge is the Mappings .Configuration
had many private property fields,e.g.  classes,collections,tables,imports and so on.when call HbmBinder to work,Configuration first createMappings with its property fields then pass the Mappings  to the HbmBinder .In HbmBinder ,what Mappings   had done is also the  Configuration 's field done.

e.g. Configuration  has a field "imports" ,it gone with the Mappings as a parameter in Mappings constructor to HbmBinder .
in HbmBinder class ,HbmBinder use Mappings .addImport() to operate it and at the same time point to the Configuration's "imports".This is correlative to java's clone mechanism.

this gives us a exquisite way to deal with more properties among several class.



posted on 2006-09-25 17:39 R.Zeus 阅读(320) 评论(0)  编辑  收藏 所属分类: HibernateJ2SE

只有注册用户登录后才能发表评论。


网站导航: