【发布时间】:2014-07-03 08:52:36
【问题描述】:
我有一些 Spring 上下文配置
<bean name="propertyConfigurator" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:/com/net/model/jdbc.properties"/>
</bean>
....
<bean id="sessionFactoryToBillingDb" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
....
jdbc.properties看起来像
...
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
...
我想使用 Inellij Idea 的 HQL 控制台,但出现错误:
java.lang.RuntimeException: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.dialect.MySQLDialectt.MySQLDialect] as strategy [org.hibernate.dialect.Dialect]
org.hibernate.dialect.MySQLDialectt.MySQLDialect 怎么了?
【问题讨论】:
-
根据重复:该类名为:“MySQLDialect”,你有一个错字(方言)
-
我无法理解 jdbc.properties 中设置的 hibernate.dialect=org.hibernate.dialect.MySQLDialect 如何在 hql 控制台中转换为 org.hibernate.dialect.MySQLDialectt.MySQLDialect
-
您是否尝试打印 ${hibernate.dialect} 的内容? (例如,把它放在一个预期数字的地方,看看会发生什么)。您是否在您的项目中对文本“MySQLDialect”进行了全文搜索?
-
jdbc.properties 中的其他属性是否正确携带?
标签: spring hibernate hql propertyconfigurator