/**
* Build the session factory from the data in the configuration. This method should be called
* when all persistent classes are added to the configuration.
*/
public static void buildSessionFactory() {
configuration.setInterceptor(new CacheInterceptor());
ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry();
sessionFactory = configuration.buildSessionFactory(serviceRegistry);
}