您的位置:首页 > 其它

the design principles and code analysis of hibernate lazy loading

2013-09-05 10:49 651 查看
as we all know,Hibernate is already one of the most popular ORM frameworks. and its performance is key highlight .when we use ORM framework,there will be a lot of convertions between  objects and database tables.if it can be handled well,it will make this
framework extremely cumbersome. hibernate provides  many fabulous functionalities .or example  lazy loading. an domain object associates collections or another domain object, when initialition ,domain object will default not load collections and object entity.
only when on demands.so it can impove performance.

what are the design principles of lazy loading?

well,proxy pattern is the core principle. for colletion mapping,like set,map ,list etc ,in hibernate codes,there are PersistentSet,PersistentMap,PersistentList classes to implement these interfaces.for associated collection,Hiberate will using CLGIB,JAVAASSIST
create an proxy  object to represent collection,it actually not load during the creation of the object,only needs it load them.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐