12. What are the most common methods of Hibernate configuration?


The most common methods of Hibernate configuration are:

  • Programmatic configuration
  • XML configuration ('hibernate.cfg.xml')

Look at the sample below

Configuration cfg = new Configuration();
File file = new File('hibernate.cfg.xml'
);
cfg.configure(file);
SessionFactory sessionFactory = cfg.buildSessionFactory();

1 comment:

  1. Amazing & Great informative blog,it gives very useful practical information to developer like me. Besides that Wisen has established as Best Hibernate Training in Chennai . or learn thru Online Training mode Hibernate Online Training | Java EE Online Training. Nowadays Hibernate ORM has tons of job opportunities on various vertical industry.

    ReplyDelete