我有一个hibernate项目,我试图用xml和注释配置它,但是
写作时
<bean id="jpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
<property name="database" value="INFORMIX" />
<property name="databasePlatform" value="mypackage.MyInformixDialect" />
</bean>
它运作正常,但如果我写:
@Bean
public HibernateJpaVendorAdapter jpaVendorAdapter() {
HibernateJpaVendorAdapter h = new HibernateJpaVendorAdapter();
h.setDatabase(Database.INFORMIX);
h.setDatabasePlatform("mypackage.MyInformixDialect");
return h;
}
它说
Unable to resolve name mypackage.MyInformixDialect as strategy [org.hibernate.dialect.Dialect]
为什么?