- private static final Logger LOGGER = FlexLogger.getLogger(HibernateSession.class);
-
- private static SessionFactory logSessionFactory;
-
- static {
- try {
- Properties prop= new Properties();
- prop.setProperty("hibernate.connection.url", PolicyController.getLogdbUrl());
- prop.setProperty("hibernate.connection.username", PolicyController.getLogdbUserName());
- prop.setProperty("hibernate.connection.password", PolicyController.getLogdbPassword());
- prop.setProperty("dialect", PolicyController.getLogdbDialect());
- prop.setProperty("hibernate.connection.driver_class", PolicyController.getLogdbDriver());
- prop.setProperty("show_sql", "false");
- logSessionFactory = new Configuration().addPackage("org.onap.policy.*").addProperties(prop)
- .addAnnotatedClass(SystemLogDB.class).buildSessionFactory();
- } catch (Exception ex) {
- LOGGER.error("Exception Occured while creating Log database Hibernate session"+ex);
- }
- }