title: Create session factory in Hibernate 4
body: <p>I'm having trouble generating a session factory in Hibernate 4. In Hibernate 3 I simple did:</p>
  
  <pre><code>org.hibernate.cfg.Configuration conf= HibernateUtil
      .getLimsInitializedConfiguration(systemConfiguration
  .getHibernateconfFile());
  
  SessionFactory sf = conf.configure().buildSessionFactory();
  </code></pre>
  
  <p>Now I need to pass a ServiceRegistry class to buildSessionFactory, but the Javadocs are extremely vague on how to go about this. Any tips?</p>