See https://github.com/spring-projects/spring-boot/issues/44701 for background.

We could introduce new attribute like referenceKey for @DefaultValue


@DefautValue(referenceKey = "spring.sql.init.mode")
private DatabaseInitializationMode initializeSchema = DatabaseInitializationMode.EMBEDDED;
  • initializeSchema will be the initial value of field( here is EMBEDDED) or value of @DefaultValue (for constructor parameter) if both spring.sql.init.mode and spring.batch.jdbc.initialize-schema are missing
  • initializeSchema will be bound to spring.sql.init.mode if spring.batch.jdbc.initialize-schema is missing
  • initializeSchema will always be bound to spring.batch.jdbc.initialize-schema if it's present