Last active
August 29, 2015 14:15
-
-
Save margielm/b10fffce7502a84ea23f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Configuration | |
@ComponentScan | |
@EnableAutoConfiguration | |
public class Application { | |
@Autowired | |
private UserRepository repository; | |
public static void main(String[] args) { | |
SpringApplication.run(Application.class, args); | |
} | |
@Bean | |
InitializingBean init() { | |
return () -> { | |
repository.save(new User("John", "Smith")); | |
}; | |
} | |
} |
może być i tak, chodziło o koncept i użycie InitializingBean
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nie lepiej by bylo jak poniżej?