From 552e7fb1d590d42940079d43a2efdd9487551a54 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 5 Sep 2023 14:47:12 +0200 Subject: [PATCH] Test another scenario --- .../simple/SimpleJdbcInsertIntegrationTests.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertIntegrationTests.java b/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertIntegrationTests.java index c168f925b0..8f18bea2ad 100644 --- a/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertIntegrationTests.java +++ b/spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertIntegrationTests.java @@ -55,6 +55,20 @@ class SimpleJdbcInsertIntegrationTests { insertJaneSmith(insert); } + @Test // gh-24013 + void retrieveColumnNamesFromMetadataAndUsingQuotedIdentifiers() throws Exception { + SimpleJdbcInsert insert = new SimpleJdbcInsert(embeddedDatabase) + .withTableName("users") + .usingGeneratedKeyColumns("id") + .usingQuotedIdentifiers(); + + insert.compile(); + // NOTE: quoted identifiers in H2/HSQL will be UPPERCASE! + assertThat(insert.getInsertString()).isEqualTo("INSERT INTO \"USERS\" (\"FIRST_NAME\", \"LAST_NAME\") VALUES(?, ?)"); + + insertJaneSmith(insert); + } + @Test void usingColumns() { SimpleJdbcInsert insert = new SimpleJdbcInsert(embeddedDatabase)