Skip to content

Add static variables to prevent typos in the metadata tables string path #4586

@spring0913

Description

@spring0913

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();
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions