Unconditionally add @DependsOnDatabaseInitialization to Spring beans and components depending on javax.sql.DataSource

MSAL

Beans of certain well-known types, such as JdbcTemplate, will be ordered so that they are initialized after the database has been initialized. If you have a bean that works with the DataSource directly, annotate its class or @Bean method with @DependsOnDatabaseInitialization to ensure that it too is initialized after the database has been initialized. See the release notes for more. This recipe will not check if the @DependsOnDatabaseInitialization annotation is on the classpath. This recipe is best combined with a precondition, as seen in DatabaseComponentAndBeanInitializationOrdering.

org.openrewrite.java.spring.boot2.DatabaseComponentAndBeanInitializationOrderingUnconditionally
mod run . --recipe=org.openrewrite.java.spring.boot2.DatabaseComponentAndBeanInitializationOrderingUnconditionally

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.