HibernateJPaVendorAdapter:无法将字符串类型的值转换为所需的类型'org.springframework.orm.jpa.vendor.Database'ENitty

时间:2018-08-09 05:38:47

标签: spring hibernate spring-data hibernate-entitymanager spring-orm

我已经在spring xml文件中配置了我的EntityManagerFactory,例如:

<bean id="entityManagerFactory"
       class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="dataSource" ref="tesDataSource" />
        <property name="jpaVendorAdapter">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                <property name="database" value="${tes.db.database:ORACLE}"/>
                <property name="showSql" value="${tes.db.showSql:false}"/>
                <property name="generateDdl" value="${tes.db.generateDdl:false}"/>
                <property name="databasePlatform" value="${tes.db.dialect:org.hibernate.dialect.Oracle10gDialect}"/>
            </bean>
        </property>
</bean>

但是我遇到了以下错误:

java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'org.springframework.orm.jpa.vendor.Database' for property 'database': no matching editors or conversion strategy found

我真的打算将此属性默认为ORACLE。请帮帮我。

0 个答案:

没有答案