/
The_Emperor
/
SberProject
Обзор
Документация
Войти
/
The_Emperor
/
SberProject
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
develop
src/main/java/com/example/util/HibernateUtil.java
28 строк
957 B
Leks
init
25 июн 2025, 12:34
25 июн 2025, 12:34
ca16b29
Код
Авторство
О чём код?
//package com.example.util; // //import org.hibernate.SessionFactory; //import org.hibernate.cfg.Configuration; // //public class HibernateUtil { // private static final SessionFactory sessionFactory = buildSessionFactory(); // // private static SessionFactory buildSessionFactory() { // try { // // Create the SessionFactory from hibernate.cfg.xml // return new Configuration().configure().buildSessionFactory(); // } catch (Throwable ex) { // // Make sure you log the exception, as it might be swallowed // System.err.println("Initial SessionFactory creation failed." + ex); // throw new ExceptionInInitializerError(ex); // } // } // // public static SessionFactory getSessionFactory() { // return sessionFactory; // } // // public static void shutdown() { // // Close caches and connection pools // getSessionFactory().close(); // } //}