Skip to content

Instantly share code, notes, and snippets.

@dima767
Created June 16, 2014 15:31
Show Gist options
  • Select an option

  • Save dima767/63562bc476f3fd040588 to your computer and use it in GitHub Desktop.

Select an option

Save dima767/63562bc476f3fd040588 to your computer and use it in GitHub Desktop.
@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