diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java index 99b198928b..2bc143a935 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/JpaProperties.java @@ -240,17 +240,11 @@ public class JpaProperties { private String determineDdlAuto(Map existing, Supplier defaultDdlAuto) { - if (!existing.containsKey("hibernate.hbm2ddl.auto")) { - String ddlAuto = (this.ddlAuto != null ? this.ddlAuto - : defaultDdlAuto.get()); - if (!"none".equals(ddlAuto)) { - return ddlAuto; - } + String ddlAuto = existing.get("hibernate.hbm2ddl.auto"); + if (ddlAuto != null) { + return ddlAuto; } - if (existing.containsKey("hibernate.hbm2ddl.auto")) { - return existing.get("hibernate.hbm2ddl.auto"); - } - return "none"; + return this.ddlAuto != null ? this.ddlAuto : defaultDdlAuto.get(); } }