Created
June 16, 2014 15:31
-
-
Save dima767/63562bc476f3fd040588 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
| @EnableAutoConfiguration | |
| @ComponentScan | |
| class SampleApplication implements ApplicationListener<ContextRefreshedEvent> { | |
| static void main(String[] args) throws Exception { | |
| SpringApplication.run(SampleApplication.class, args) | |
| } | |
| @Override | |
| void onApplicationEvent(ContextRefreshedEvent event) { | |
| GormBootstrap.init() | |
| } | |
| @Slf4j | |
| static class GormBootstrap { | |
| static init() { | |
| log.info 'GORM bootstrap+++++++++++++++' | |
| new Person(firstName: 'GORM', lastName: 'INITED!').save(flush: true) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment