From aa60d60b8a5f319006314e565d01ea7dfb389a0d Mon Sep 17 00:00:00 2001 From: Johnny Lim Date: Thu, 3 May 2018 17:19:41 +0900 Subject: [PATCH] Polish JpaProperties.determineDdlAuto() Closes gh-13036 --- .../boot/autoconfigure/orm/jpa/JpaProperties.java | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) 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(); } }