class HibernateUtil {

  private static final SessionFactory sessionFactory = buildSessionFactory();

  /**
   * Hide constructor.
   */
  private HibernateUtil() {}

  /**
   * Build session factory.
   * @return session factory
   */
  private static SessionFactory buildSessionFactory() {<FILL_FUNCTION_BODY>}

  /**
   * Get session factory.
   * @return session factory
   */
  public static SessionFactory getSessionFactory() {
    return sessionFactory;
  }

  /**
   * Close session factory.
   */
  public static void shutdown() {
    // Close caches and connection pools
    getSessionFactory().close();
  }

}

    // Create the SessionFactory from hibernate.cfg.xml
    return new Configuration().configure().buildSessionFactory();
  
<no_super_class>