Spring MVC + hibernate 无法创建 DDL

Spring MVC + hibernate cannot create DDL

我的 Hibernate + spring 应用程序无法创建 DDL。这是我的配置。

我的 WebApp.xml 是

以及 org.ex.doqi.domain 包中的我的实体

WAS 是 wildfly 9,启动日志是

    17:21:05,667 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2) WFLYSRV0027: Starting deployment of "ex11-1.0-SNAPSHOT.war" (runtime-name: "ex11-1.0-SNAPSHOT.war")
17:21:13,825 WARN  [org.jboss.as.ee] (MSC service thread 1-4) WFLYEE0007: Not installing optional component org.springframework.http.server.ServletServerHttpAsyncRequestControl due to an exception (enable DEBUG log level to see the cause)
17:21:13,831 WARN  [org.jboss.as.ee] (MSC service thread 1-4) WFLYEE0007: Not installing optional component org.springframework.web.context.request.async.StandardServletAsyncWebRequest due to an exception (enable DEBUG log level to see the cause)
17:21:14,103 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) WFLYJCA0005: Deploying non-JDBC-compliant driver class org.mariadb.jdbc.Driver (version 1.2)
17:21:14,104 WARN  [org.jboss.weld.deployer] (MSC service thread 1-4) WFLYWELD0013: Deployment deployment "ex11-1.0-SNAPSHOT.war" contains CDI annotations but no bean archive was not found. (No beans.xml nor class with bean defining annotations)
17:21:14,171 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-1) WFLYJCA0018: Started Driver service with driver-name = ex11-1.0-SNAPSHOT.war_org.mariadb.jdbc.Driver_1_2
17:21:14,494 INFO  [io.undertow.servlet] (ServerService Thread Pool -- 68) No Spring WebApplicationInitializer types detected on classpath
17:21:14,528 INFO  [io.undertow.servlet] (ServerService Thread Pool -- 68) Initializing Spring root WebApplicationContext
17:21:14,534 INFO  [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 68) Root WebApplicationContext: initialization started
17:21:14,789 INFO  [org.springframework.web.context.support.XmlWebApplicationContext] (ServerService Thread Pool -- 68) Refreshing Root WebApplicationContext: startup date [Wed Feb 10 17:21:14 KST 2016]; root of context hierarchy
17:21:15,365 INFO  [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (ServerService Thread Pool -- 68) Loading XML bean definitions from class path resource [appConfig.xml]
17:21:16,197 INFO  [org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor] (ServerService Thread Pool -- 68) JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
17:21:16,536 INFO  [org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean] (ServerService Thread Pool -- 68) Building JPA container EntityManagerFactory for persistence unit 'jpa11'
17:21:16,548 INFO  [org.hibernate.jpa.internal.util.LogHelper] (ServerService Thread Pool -- 68) HHH000204: Processing PersistenceUnitInfo [
    name: jpa11
    ...]
17:21:16,725 INFO  [org.hibernate.Version] (ServerService Thread Pool -- 68) HHH000412: Hibernate Core {4.3.11.Final}
17:21:16,735 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 68) HHH000206: hibernate.properties not found
17:21:16,740 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 68) HHH000021: Bytecode provider name : javassist
17:21:17,002 INFO  [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 68) HCANN000001: Hibernate Commons Annotations {4.0.5.Final}
17:21:17,600 INFO  [org.hibernate.dialect.Dialect] (ServerService Thread Pool -- 68) HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
17:21:17,920 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (ServerService Thread Pool -- 68) HHH000397: Using ASTQueryTranslatorFactory
17:21:17,981 INFO  [org.hibernate.validator.internal.util.Version] (ServerService Thread Pool -- 68) HV000001: Hibernate Validator 5.1.3.Final
17:21:18,917 INFO  [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 68) Root WebApplicationContext: initialization completed in 4383 ms

问题

即使 "hibernate.hdm2ddl.auto" 选项为真,为什么 spring 上下文无法创建 DDL?

属性 是 hibernate.hbm2ddl.auto 而不是 hibernate.hdm2ddl.auto

d 替换为 b in hdm2ddl.

来自 documentation -

hibernate.hbm2ddl.auto

Automatically validates or exports schema DDL to the database when the SessionFactory is created. With create-drop, the database schema will be dropped when the SessionFactory is closed explicitly. e.g. validate | update | create | create-drop