private static SessionFactory buildSessionFactory() {
		SessionFactory sessionFactory = null;
		
		try {
	        Configuration configuration = new Configuration();
	        configuration.configure("hibernate.cfg.xml");
	        ServiceRegistryBuilder serviceRegistryBuilder = new ServiceRegistryBuilder().applySettings(configuration
	                        .getProperties());
	        sessionFactory = configuration
	                        .buildSessionFactory(serviceRegistryBuilder.buildServiceRegistry());
		}catch (Exception e){
			logger.error("Could not get the SessionFactory using the hibernate config file:"+e.getMessage());
			e.printStackTrace();
		}
		
		return sessionFactory;
    }