myeclipse8.5的hql文件连接查询报错的解决办法A session factory for this configuration

解决MyEclipse中因更改hibernate配置文件名导致无法构建SessionFactory的问题,通过修改工程目录下的隐藏配置文件来恢复正常。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我的myeclipse8.5

hibernate.cfg.xml文件名改为hibernate.cfg1.xml了, 后面没怎么管, 项目开发到一段时间了,

想用用hql.hql文件测试一下自己的的hql语句。

遇到如下错误提示:

A session factory for this configuration could not be built,dynamic query translation will be unavailable . Queries cannot be executed.

google的一下也没结果, 偶然想到myeclipse的很多配件文件都在 .project等这类文件中, 上次优化myeclipse就是在里面改的。

视图在工程目录查找hibernate.cfg1.xml文件, 果然在.myhibernatedata文件中发现了如下

#MyEclipse Hibernate Properties
#Mon Sep 13 10:51:01 CST 2010
sessionFactoryName=hql.HibernateSessionFactory
genBasicCompId=true
profile=
daoSFId=
version=3.3
jndiPath=
detectM2M=true
reStrategyClass=
detectO2O=true
springDaoFile=
useJavaTypes=false
keyGenerator=uuid.hex
libInstallFolder=WebRoot/WEB-INF/lib
addLibs2Project=true
genVersionTag=false
sessionFactoryId=
basePersistenceClass=
genAnnotations=true
reSettingsFile=/wsd-auth/hibernate.reveng.xml
configFile=/auth/src/hibernate.cfg1.xml
createConfigFile=true
addLibs2Classpath=true

修改一下这里的配置就可以了^_^

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值