import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
import org.hibernate.cfg.Configuration;
import org.hibernate.service.ServiceRegistry;
public class HibernateUtil {
private static SessionFactory sf=null;
static{
//1.创建Configuration,该对象用于读取hibernate.cfg.xml,并完成初始化
Configuration cfg=new Configuration();
cfg.configure();
//2.创建SessoinFactory[这是一个会话工厂,是一个重量级的对象
ServiceRegistry sr = new StandardServiceRegistryBuilder().applySettings(cfg.getProperties()).build();
sf = cfg.buildSessionFactory(sr);
}
public static Session getSession(){
return sf.openSession();
}
}Hibernate4.3.8 buildSessionFactory过时解决方案HibernateUtil
部署运行你感兴趣的模型镜像
您可能感兴趣的与本文相关的镜像
Llama Factory
模型微调
LLama-Factory
LLaMA Factory 是一个简单易用且高效的大型语言模型(Large Language Model)训练与微调平台。通过 LLaMA Factory,可以在无需编写任何代码的前提下,在本地完成上百种预训练模型的微调
158

被折叠的 条评论
为什么被折叠?



