Browse Source

Test another scenario

pull/31186/head
Sam Brannen 2 years ago
parent
commit
552e7fb1d5
  1. 14
      spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertIntegrationTests.java

14
spring-jdbc/src/test/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertIntegrationTests.java

@ -55,6 +55,20 @@ class SimpleJdbcInsertIntegrationTests { @@ -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)

Loading…
Cancel
Save