diff --git a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/resources/city-schema.sql b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/resources/city-schema.sql index 7e3a3462e00d..b2a4112add91 100644 --- a/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/resources/city-schema.sql +++ b/spring-boot-project/spring-boot-actuator-autoconfigure/src/test/resources/city-schema.sql @@ -1,5 +1,5 @@ CREATE TABLE CITY ( - id INTEGER IDENTITY PRIMARY KEY, + id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, name VARCHAR(30), state VARCHAR(30), country VARCHAR(30), diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/r2dbc/ConnectionFactoryHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/r2dbc/ConnectionFactoryHealthIndicatorTests.java index 0622036d9c67..f22484d7a438 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/r2dbc/ConnectionFactoryHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/r2dbc/ConnectionFactoryHealthIndicatorTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 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. @@ -98,9 +98,11 @@ void healthIndicatorWhenDatabaseUpWithSuccessValidationQuery() { CloseableConnectionFactory connectionFactory = createTestDatabase(); try { String customValidationQuery = "SELECT COUNT(*) from HEALTH_TEST"; - Mono.from(connectionFactory.create()).flatMapMany((it) -> Flux - .from(it.createStatement("CREATE TABLE HEALTH_TEST (id INTEGER IDENTITY PRIMARY KEY)").execute()) - .flatMap(Result::getRowsUpdated).thenMany(it.close())).as(StepVerifier::create).verifyComplete(); + String createTableStatement = "CREATE TABLE HEALTH_TEST (id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY)"; + Mono.from(connectionFactory.create()) + .flatMapMany((it) -> Flux.from(it.createStatement(createTableStatement).execute()) + .flatMap(Result::getRowsUpdated).thenMany(it.close())) + .as(StepVerifier::create).verifyComplete(); ReactiveHealthIndicator healthIndicator = new ConnectionFactoryHealthIndicator(connectionFactory, customValidationQuery); healthIndicator.health().as(StepVerifier::create).assertNext((actual) -> { diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java index 01fd02c7caf3..8ea9b44517bc 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationTests.java @@ -217,7 +217,7 @@ void testRenamePrefix() { .withUserConfiguration(TestConfiguration.class, EmbeddedDataSourceConfiguration.class, HibernateJpaAutoConfiguration.class) .withPropertyValues("spring.datasource.generate-unique-name=true", - "spring.batch.jdbc.schema:classpath:batch/custom-schema-hsql.sql", + "spring.batch.jdbc.schema:classpath:batch/custom-schema.sql", "spring.batch.jdbc.tablePrefix:PREFIX_") .run((context) -> { assertThat(context).hasSingleBean(JobLauncher.class); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationWithoutJpaTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationWithoutJpaTests.java index 6c7f56287f0a..df297842ea1f 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationWithoutJpaTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/batch/BatchAutoConfigurationWithoutJpaTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2021 the original author or authors. + * Copyright 2012-2022 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. @@ -73,7 +73,7 @@ void jdbcWithDefaultSettings() { void jdbcWithCustomPrefix() { this.contextRunner.withUserConfiguration(DefaultConfiguration.class, EmbeddedDataSourceConfiguration.class) .withPropertyValues("spring.datasource.generate-unique-name=true", - "spring.batch.jdbc.schema:classpath:batch/custom-schema-hsql.sql", + "spring.batch.jdbc.schema:classpath:batch/custom-schema.sql", "spring.batch.jdbc.tablePrefix:PREFIX_") .run((context) -> { assertThat(new JdbcTemplate(context.getBean(DataSource.class)) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/batch/custom-schema-hsql.sql b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/batch/custom-schema.sql similarity index 87% rename from spring-boot-project/spring-boot-autoconfigure/src/test/resources/batch/custom-schema-hsql.sql rename to spring-boot-project/spring-boot-autoconfigure/src/test/resources/batch/custom-schema.sql index 4ce9dc78abf9..7b02ff0ed0f2 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/batch/custom-schema-hsql.sql +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/batch/custom-schema.sql @@ -1,7 +1,7 @@ -- Autogenerated: do not edit this file CREATE TABLE PREFIX_JOB_INSTANCE ( - JOB_INSTANCE_ID BIGINT IDENTITY NOT NULL PRIMARY KEY , + JOB_INSTANCE_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY , VERSION BIGINT , JOB_NAME VARCHAR(100) NOT NULL, JOB_KEY VARCHAR(32) NOT NULL, @@ -9,7 +9,7 @@ CREATE TABLE PREFIX_JOB_INSTANCE ( ) ; CREATE TABLE PREFIX_JOB_EXECUTION ( - JOB_EXECUTION_ID BIGINT IDENTITY NOT NULL PRIMARY KEY , + JOB_EXECUTION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY , VERSION BIGINT , JOB_INSTANCE_ID BIGINT NOT NULL, CREATE_TIME TIMESTAMP NOT NULL, @@ -38,7 +38,7 @@ CREATE TABLE PREFIX_JOB_EXECUTION_PARAMS ( ) ; CREATE TABLE PREFIX_STEP_EXECUTION ( - STEP_EXECUTION_ID BIGINT IDENTITY NOT NULL PRIMARY KEY , + STEP_EXECUTION_ID BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY , VERSION BIGINT NOT NULL, STEP_NAME VARCHAR(100) NOT NULL, JOB_EXECUTION_ID BIGINT NOT NULL, @@ -77,11 +77,11 @@ CREATE TABLE PREFIX_JOB_EXECUTION_CONTEXT ( ) ; CREATE TABLE PREFIX_STEP_EXECUTION_SEQ ( - ID BIGINT IDENTITY + ID BIGINT GENERATED BY DEFAULT AS IDENTITY ); CREATE TABLE PREFIX_JOB_EXECUTION_SEQ ( - ID BIGINT IDENTITY + ID BIGINT GENERATED BY DEFAULT AS IDENTITY ); CREATE TABLE PREFIX_JOB_SEQ ( - ID BIGINT IDENTITY + ID BIGINT GENERATED BY DEFAULT AS IDENTITY ); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/data-city-schema.sql b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/data-city-schema.sql index 7e3a3462e00d..b2a4112add91 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/data-city-schema.sql +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/data-city-schema.sql @@ -1,5 +1,5 @@ CREATE TABLE CITY ( - id INTEGER IDENTITY PRIMARY KEY, + id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, name VARCHAR(30), state VARCHAR(30), country VARCHAR(30), diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/another.sql b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/another.sql index 8377bedeed09..b4974a01bbfa 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/another.sql +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/another.sql @@ -1,4 +1,4 @@ CREATE TABLE SPAM ( - id INTEGER IDENTITY PRIMARY KEY, + id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, name VARCHAR(30) ); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/lexical-schema-aaa.sql b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/lexical-schema-aaa.sql index 86d05121f0ba..5d4523e1e17b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/lexical-schema-aaa.sql +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/lexical-schema-aaa.sql @@ -1,4 +1,4 @@ CREATE TABLE FOO ( - id INTEGER IDENTITY PRIMARY KEY, + id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, todrop VARCHAR(30) ); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/schema.sql b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/schema.sql index 84a4ad9d93af..1014a04db4a9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/schema.sql +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/org/springframework/boot/autoconfigure/jdbc/schema.sql @@ -1,4 +1,4 @@ CREATE TABLE FOO ( - id INTEGER IDENTITY PRIMARY KEY, + id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, name VARCHAR(30) ); diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/schema.sql b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/schema.sql index f9a35403a703..7f7a6f01a578 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/resources/schema.sql +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/resources/schema.sql @@ -1,4 +1,4 @@ CREATE TABLE BAR ( - id INTEGER IDENTITY PRIMARY KEY, + id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, name VARCHAR(30) ); diff --git a/spring-boot-project/spring-boot-cli/src/test/resources/schema-all.sql b/spring-boot-project/spring-boot-cli/src/test/resources/schema-all.sql index 84a4ad9d93af..1014a04db4a9 100644 --- a/spring-boot-project/spring-boot-cli/src/test/resources/schema-all.sql +++ b/spring-boot-project/spring-boot-cli/src/test/resources/schema-all.sql @@ -1,4 +1,4 @@ CREATE TABLE FOO ( - id INTEGER IDENTITY PRIMARY KEY, + id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, name VARCHAR(30) ); diff --git a/spring-boot-project/spring-boot/src/test/resources/schema.sql b/spring-boot-project/spring-boot/src/test/resources/schema.sql index 73d14cd310a3..556b5e372a9f 100644 --- a/spring-boot-project/spring-boot/src/test/resources/schema.sql +++ b/spring-boot-project/spring-boot/src/test/resources/schema.sql @@ -1,4 +1,4 @@ CREATE TABLE EXAMPLE ( - id INTEGER IDENTITY PRIMARY KEY, + id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, name VARCHAR(30) ); \ No newline at end of file diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jdbc/src/main/resources/schema.sql b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jdbc/src/main/resources/schema.sql index 1b999f2e8015..bd0b5fb7a011 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jdbc/src/main/resources/schema.sql +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-jdbc/src/main/resources/schema.sql @@ -1,5 +1,5 @@ CREATE TABLE CUSTOMER ( - ID INTEGER IDENTITY PRIMARY KEY, + ID INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, FIRST_NAME VARCHAR(30), DATE_OF_BIRTH DATE ); diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-r2dbc/src/main/resources/schema.sql b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-r2dbc/src/main/resources/schema.sql index 88217dc41bbc..60aa64a368a8 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-r2dbc/src/main/resources/schema.sql +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-r2dbc/src/main/resources/schema.sql @@ -1,5 +1,5 @@ CREATE TABLE CITY ( - id INTEGER IDENTITY PRIMARY KEY, + id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, name VARCHAR(30), state VARCHAR(30), country VARCHAR(30)