File tree Expand file tree Collapse file tree 4 files changed +6
-6
lines changed
complete-kotlin/src/main/kotlin/com/example/managingtransactions Expand file tree Collapse file tree 4 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ To manually initialize the project:
2828
2929. Navigate to https://start.spring.io.
3030This service pulls in all the dependencies you need for an application and does most of the setup for you.
31- . Choose either Gradle or Maven and the language you want to use: Kotlin or Java .
31+ . Choose either Gradle or Maven and the language you want to use.
3232. Click *Dependencies* and select *Spring Data JDBC* and *H2 Database*.
3333. Click *Generate*.
3434. Download the resulting ZIP file, which is an archive of a web application that is configured with your choices.
Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ import org.springframework.boot.CommandLineRunner
55import org.springframework.stereotype.Component
66import org.springframework.util.Assert
77
8+ private val logger = LoggerFactory .getLogger(AppRunner ::class .java)
9+
810@Component
911class AppRunner (private val bookingService : BookingService ) : CommandLineRunner {
1012
11- private val logger = LoggerFactory .getLogger(javaClass)
12-
1313 override fun run (vararg args : String ) {
1414 bookingService.book(" Alice" , " Bob" , " Carol" )
1515 Assert .isTrue(bookingService.findAllBookings().size == 3 ,
Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ import org.springframework.jdbc.core.JdbcTemplate
55import org.springframework.stereotype.Component
66import org.springframework.transaction.annotation.Transactional
77
8+ private val logger = LoggerFactory .getLogger(BookingService ::class .java)
9+
810@Component
911class BookingService (private val jdbcTemplate : JdbcTemplate ) {
1012
11- private val logger = LoggerFactory .getLogger(javaClass)
12-
1313 @Transactional
1414 fun book (vararg persons : String? ) {
1515 persons.forEach { person ->
@@ -22,4 +22,4 @@ class BookingService(private val jdbcTemplate: JdbcTemplate) {
2222 jdbcTemplate.query(" select FIRST_NAME from BOOKINGS" ) { rs, _ ->
2323 rs.getString(" FIRST_NAME" )
2424 }
25- }
25+ }
You can’t perform that action at this time.
0 commit comments