Hibernate不会创建我的表

Max*_*Max 4 java spring hibernate java-ee

我使用Spring和Hibernate时遇到了一个奇怪的问题.我在hibernate.cfg.xml中开始使用Hibernate:

<property name="hbm2ddl.auto">create</property>
Run Code Online (Sandbox Code Playgroud)

它工作正常,Hibernate成功创建了数据库中所需的表.现在我使用Spring,我在applicationContext.xml中用于hibernate的bean看起来像这样:

<bean id="mySessionFactory"
    class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource" ref="myDataSource" />
    <property name="mappingResources">
        <list>
            <value>domain/Entity.hbm.xml</value>
            <value>domain/Service.hbm.xml</value>
            <value>domain/User.hbm.xml</value>
            <value>domain/Arcos.hbm.xml</value>
        </list>
    </property>
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
            <prop key="hibernate.hbm2dll.auto">create</prop>
        </props>
    </property>
</bean>
Run Code Online (Sandbox Code Playgroud)

我不得不在某些时候删除Hibernate创建的表,但Spring不会创建它们.我试过create-drop而不是create(以防万一有人问).我的数据库模式已经改变,因为我使用了Hibernate并且我getBeans("...");在我的代码中使用了很多,所以有点困扰我只重用我的Hibernate版本来创建表.我也可以手工创建表,但是使用这些框架有什么意义呢?

我确定我在某处做错了什么,但我找不到它.控制台提示错误,指出没有名为"表名" 的表,因此它成功连接到数据库.

谢谢你的时间 :)

JB *_*zet 13

hibernate.hbm2dll.auto - > hibernate.hbm2ddl.auto

DLL =动态链接库

DDL =数据定义语言