You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spring-boot/spring-boot-cli/samples/tx.groovy

19 lines
330 B
Groovy

package org.test
@Grab("org.hsqldb:hsqldb:2.2.9")
@Configuration
@EnableTransactionManagement
class Example implements CommandLineRunner {
@Autowired
JdbcTemplate jdbcTemplate
@Transactional
void run(String... args) {
println "Foo count=" + jdbcTemplate.queryForObject("SELECT COUNT(*) from FOO", Integer)
}
}