spring-batch
spring-batch copied to clipboard
Add static variables to prevent typos in the metadata tables string path
From the #4252, I realized that I had to use addScript to create the metadata table when using an In-memory database in Spring Boot 3.0 / Spring Batch 5.0.
I think it is better to use static variables to prevent typos in the metadata table creation script path string.
After I create PR about this(schema-h2), if it is approved, I would like to add static variables to the other databases as well.
AS-IS
@Bean
public DataSource dataSource() {
return new EmbeddedDatabaseBuilder()
.addScript("/org/springframework/batch/core/schema-h2.sql")
.build();
}
TO-BE
@Bean
public DataSource dataSource() {
return new EmbeddedDatabaseBuilder()
.addScript(DatabaseResource.SCHEMA_H2)
.build();
}