Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Session Factory in Hibernate

Obtaining a Session Factory:  All the mappings have been parsed by configuration object Hibernate uses run time reflection to determine the persistent properties of a class.The objects which are to be persisted are define on mapping document, which describes persistent fields and associations as well as sub classes and proxies of the persistent object.Mapping documents are compiled at application start up and provide the frame work with necessary information.

   The Session Factory is created from the complied collection of mappings and it provides the mechanism for managing persistent classes known as Session interface.

  This Session Factory is also very expensive in terms of memory and space, hence we create only factory object for entire application.

          Configuration cfg=new Configuration();
           cfg.configure();
          SessionFactory sf=cfg.buildSessionFactory();




                                                                                                 Vissu



This post first appeared on Java Spring Hibernate, please read the originial post: here

Share the post

Session Factory in Hibernate

×

Subscribe to Java Spring Hibernate

Get updates delivered right to your inbox!

Thank you for your subscription

×