Hibernate创建SessionFactory实例
private static SessionFactory sessionFactory = null;
static
{
Configuration configuration =new Configuration();
configuration.configure();
ServiceRegistry serviceRegistry =new ServiceRegistryBuilder().applySettings(configuration.getProperties()).buildServiceRegistry();
sessionFactory = configuration.buildSessionFactory(serviceRegistry);
}