2019-06-03 08:46:04 +03:00
|
|
|
package pro.gravit.launchserver.hibernate;
|
|
|
|
|
2019-06-03 13:56:54 +03:00
|
|
|
import java.util.Map;
|
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
2019-06-03 08:46:04 +03:00
|
|
|
import org.hibernate.SessionFactory;
|
|
|
|
|
2019-06-03 13:56:54 +03:00
|
|
|
import pro.gravit.launchserver.LaunchServer;
|
|
|
|
|
2019-06-03 08:46:04 +03:00
|
|
|
public class HibernateManager {
|
2019-06-03 13:56:54 +03:00
|
|
|
private static final Map<LaunchServer, SessionFactory> sessionMap = new ConcurrentHashMap<>();
|
|
|
|
|
|
|
|
public static SessionFactory getSessionFactory(LaunchServer srv) {
|
|
|
|
return sessionMap.get(srv);
|
|
|
|
};
|
|
|
|
|
|
|
|
public static SessionFactory setSessionFactory(LaunchServer srv, SessionFactory fact) {
|
|
|
|
return sessionMap.get(srv);
|
|
|
|
};
|
2019-06-03 08:46:04 +03:00
|
|
|
}
|