From d38b38473d78982ec7bd5c991e56d9e8adde21cb Mon Sep 17 00:00:00 2001 From: VladSlob <141657806+VladSlob@users.noreply.github.com> Date: Sun, 28 Jul 2024 07:38:24 +0300 Subject: [PATCH] HibernateUtil.java --- src/main/java/mate/academy/util/HibernateUtil.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/mate/academy/util/HibernateUtil.java b/src/main/java/mate/academy/util/HibernateUtil.java index 19e14d1a..d939efad 100644 --- a/src/main/java/mate/academy/util/HibernateUtil.java +++ b/src/main/java/mate/academy/util/HibernateUtil.java @@ -6,6 +6,10 @@ public class HibernateUtil { private static final SessionFactory sessionFactory = buildSessionFactory(); + private HibernateUtil() { + // Private constructor to prevent instantiation + } + private static SessionFactory buildSessionFactory() { try { return new Configuration().configure().buildSessionFactory(); @@ -17,8 +21,4 @@ private static SessionFactory buildSessionFactory() { public static SessionFactory getSessionFactory() { return sessionFactory; } - - private HibernateUtil() { - // Private constructor to prevent instantiation - } }