update
This commit is contained in:
parent
2992f4f408
commit
4f46de8d00
3330 changed files with 394553 additions and 76939 deletions
1
.config/Code/User/History/-61b3b463/entries.json
Normal file
1
.config/Code/User/History/-61b3b463/entries.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":1,"resource":"file:///home/rafayahmad/Stuff/Coding/Java/HCloud/hcloudserver/src/main/java/com/rutils/HibernateUtil.java","entries":[{"id":"g1v0.java","timestamp":1720764260936}]}
|
27
.config/Code/User/History/-61b3b463/g1v0.java
Normal file
27
.config/Code/User/History/-61b3b463/g1v0.java
Normal file
|
@ -0,0 +1,27 @@
|
|||
package com.rutils;
|
||||
|
||||
import org.hibernate.SessionFactory;
|
||||
import org.hibernate.cfg.Configuration;
|
||||
|
||||
public class HibernateUtil{
|
||||
private static final SessionFactory sessionFactory = buildSessionFactory();
|
||||
|
||||
private static SessionFactory buildSessionFactory(){
|
||||
try{
|
||||
return new Configuration().configure().buildSessionFactory();
|
||||
}
|
||||
catch(Throwable e){
|
||||
System.err.println("Session Factory creation failed" + e);
|
||||
throw new ExceptionInInitializerError(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static SessionFactory getSessionfactory(){
|
||||
return sessionFactory;
|
||||
}
|
||||
|
||||
public static void shutdown(){
|
||||
getSessionfactory().close();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue