Skip to content

Commit 4de0adb

Browse files
committed
DATAJDBC-example added Listeners.
1 parent 6cfe4fb commit 4de0adb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

jdbc/basics/src/test/java/example/springdata/jdbc/basics/config/TestContextConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ DataSource dataSource() {
4747
.build();
4848
}
4949

50+
@Bean
5051
public ApplicationListener<?> loggingListener(){
5152
return (ApplicationListener<JdbcEvent>) jdbcEvent -> System.out.println("received an event: " + jdbcEvent);
5253
}
5354

55+
@Bean
5456
public ApplicationListener<?> idGenerator(){
5557
return (ApplicationListener<BeforeInsert>) jdbcEvent -> ((Category)jdbcEvent.getEntity()).timeStamp();
5658
}

0 commit comments

Comments
 (0)