From 85754eaddd2112caafbbea6334ad1dc549fc6a09 Mon Sep 17 00:00:00 2001 From: Jonathan Bregler Date: Wed, 7 Nov 2018 09:50:09 +0100 Subject: [PATCH 1/2] Add HANA to the lookup of well-known databases See gh-15125 --- .../boot/autoconfigure/orm/jpa/DatabaseLookup.java | 1 + .../boot/autoconfigure/orm/jpa/DatabaseLookupTests.java | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookup.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookup.java index 1347779224..2be5115886 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookup.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookup.java @@ -53,6 +53,7 @@ final class DatabaseLookup { map.put(DatabaseDriver.SQLSERVER, Database.SQL_SERVER); map.put(DatabaseDriver.DB2, Database.DB2); map.put(DatabaseDriver.INFORMIX, Database.INFORMIX); + map.put(DatabaseDriver.HANA, Database.HANA); LOOKUP = Collections.unmodifiableMap(map); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookupTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookupTests.java index 4d334a0a8a..cf0d6ab790 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookupTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookupTests.java @@ -91,6 +91,10 @@ public class DatabaseLookupTests { public void getDatabaseWhenInformixShouldReturnInformix() throws Exception { testGetDatabase("jdbc:informix-sqli:", Database.INFORMIX); } + @Test + public void getDatabaseWhenSapShouldReturnHana() throws Exception { + testGetDatabase("jdbc:sap:", Database.HANA); + } private void testGetDatabase(String url, Database expected) throws Exception { DataSource dataSource = mock(DataSource.class); From 089ef9085a472fbb740ee462775420204d93eda7 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Sat, 10 Nov 2018 18:02:01 +0100 Subject: [PATCH 2/2] Polish "Add HANA to the lookup of well-known databases" Closes gh-15125 --- .../boot/autoconfigure/orm/jpa/DatabaseLookupTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookupTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookupTests.java index cf0d6ab790..82823ecb96 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookupTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/orm/jpa/DatabaseLookupTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,6 +91,7 @@ public class DatabaseLookupTests { public void getDatabaseWhenInformixShouldReturnInformix() throws Exception { testGetDatabase("jdbc:informix-sqli:", Database.INFORMIX); } + @Test public void getDatabaseWhenSapShouldReturnHana() throws Exception { testGetDatabase("jdbc:sap:", Database.HANA);