Test another scenario

This commit is contained in:
Sam Brannen 2023-09-05 14:47:12 +02:00
parent 884975e094
commit 552e7fb1d5
1 changed files with 14 additions and 0 deletions

View File

@ -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)