CommandLineRunner 的使用

阅读更多
@SpringBootApplication
@EnableJpaAuditing
public class ContractElementApplication extends MyApplication implements CommandLineRunner {
    public static void main(String[] args) {
        run(ContractElementApplication.class, args);
}

    @Autowired
private ElementDatasourceConfig elementDatasourceConfig;

@Override
public void run(String... args) throws Exception {
        elementDatasourceConfig.getConfig();

}
}

你可能感兴趣的:(CommandLineRunner 的使用)