spring 配置 自动创建表,错误(没有创建表)

<property name="jpaProperties">
    <props>
        <prop key="hibernate.ejb.naming_strategy">org.hibernate.cfg.ImprovedNamingStrategy</prop><!--设置ejb名字的策略-->
        <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop><!--设置数据库语言-->
        <prop key="hibernate.show_sql">true</prop><!--是否显示sql-->
        <prop key="hibernate.format_sql">true</prop><!--是否对sql进行排序-->
        <prop key="hibernate.hbm2ddl.auto">update</prop><!--根据实体创建表-->
    </props>
</property>
自动创建表不成功的原因: key中的value值中的hibernate要小写。

org.springframework.beans.factory.config.EmbeddedValueResolver 报错

是因为没有导入spring-beans这个jar包。

猜你喜欢

转载自blog.csdn.net/weixin_38723919/article/details/79629245