Skip to content

Commit f201464

Browse files
committed
Fix data-jdbc sample
See spring-atticgh-1541
1 parent 5f29f0a commit f201464

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

samples/data-jdbc/src/main/java/com/example/data/jdbc/DataJdbcConfiguration.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.springframework.context.annotation.Bean;
2323
import org.springframework.context.annotation.Configuration;
2424
import org.springframework.data.domain.AuditorAware;
25+
import org.springframework.data.relational.core.mapping.event.BeforeConvertEvent;
2526
import org.springframework.data.relational.core.mapping.event.BeforeSaveEvent;
2627

2728
@Configuration
@@ -37,7 +38,7 @@ public AuditorAware<String> anonymousAuditorAware(){
3738
@Bean
3839
public ApplicationListener<?> idSetting() {
3940

40-
return (ApplicationListener<BeforeSaveEvent>) event -> {
41+
return (ApplicationListener<BeforeConvertEvent>) event -> {
4142

4243
if (event.getEntity() instanceof LegoSet) {
4344
setIds((LegoSet) event.getEntity());

0 commit comments

Comments
 (0)