关于hibernate 4.3.5 中错误配置
来源:互联网 发布:衡水星河网络 编辑:程序博客网 时间:2024/04/29 18:49
.../hibernate-release-4.3.5.Final/documentation/manual/en-US/html_single/index.html
显然页面中的buildSessionFactory()方法中没有给出返回值,显然是hibernate团队中的在处理api时候出现的小失误。解决办法:
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 final SessionFactory sessionFactory = buildSessionFactory();
private static SessionFactory buildSessionFactory() {
try {
Configuration configuration = new Configuration().configure();
ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder()
.applySettings(configuration.getProperties()).build();
SessionFactory sessionFactory = configuration
.buildSessionFactory(serviceRegistry);
return sessionFactory;
}
catch (Throwable ex) {
System.err.println("Initial SessionFactory creation failed." + ex);
throw new ExceptionInInitializerError(ex);
}
}
- 关于hibernate 4.3.5 中错误配置
- Hibernate中关于ID配置
- 关于Hibernate AnnotationConfiguration配置错误的信息
- Hibernate中关于和的配置心得
- Hibernate配置常见错误
- Hibernate配置错误处理
- Hibernate配置常见错误
- Hibernate配置常见错误
- 关于Hibernate中延迟加载错误的处理方案
- IIS8.5关于“ 配置错误 不能在此路径中使用此配置节”的解决办法
- IIS8.5关于“ 配置错误 不能在此路径中使用此配置节”的解决办法
- IIS8.5关于“配置错误 不能在此路径中使用此配置节”的解决办法
- IIS8.5关于“ 配置错误 不能在此路径中使用此配置节”的解决办法
- 关于在hibernate中配置proxool连接池!
- 关于Hibernate中xml的配置的汇总
- 在spring中所有关于hibernate配置项说明总结
- 【j2ee spring】22、关于spring中配置hibernate的二级缓存
- 关于hibernateProperties配置中hibernate.hbm2ddl.auto参数的作用
- 键盘的某个键坏了,怎么用其它键代替?
- 如何禁止远程exp
- 利用Eclipse中的Maven构建Web项目报错(二)
- java50题----27求素数
- 【Python】Python的面向对象机制
- 关于hibernate 4.3.5 中错误配置
- 初次使用cocos2d 3.0 的box2d引擎详解
- [ACM] hdu 1671 Phone List (字典树)
- OpenSSL 常用函数——Base64编码及解码和证书操作
- 块设备驱动程序实现请求处理函数的两种方式
- Qt中加载多个txt文件
- Open SSL 常用函数——签名与验证
- Iterate through array, for each item with key collect value and make new array with key and array of
- PCA:Principle Component Analysis [3]