Skip to content

Commit 8004adc

Browse files
committed
Uses BeforeConvertEvent instead of BeforeSaveEvent.
Closes: #599
1 parent 72891d6 commit 8004adc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jdbc/basics/src/main/java/example/springdata/jdbc/basics/aggregate/AggregateConfiguration.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import org.springframework.data.jdbc.core.convert.JdbcCustomConversions;
3030
import org.springframework.data.jdbc.repository.config.AbstractJdbcConfiguration;
3131
import org.springframework.data.jdbc.repository.config.EnableJdbcRepositories;
32-
import org.springframework.data.relational.core.mapping.event.BeforeSaveEvent;
32+
import org.springframework.data.relational.core.mapping.event.BeforeConvertEvent;
3333
import org.springframework.jdbc.core.JdbcOperations;
3434
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
3535
import org.springframework.jdbc.datasource.init.DataSourceInitializer;
@@ -51,7 +51,7 @@ public class AggregateConfiguration extends AbstractJdbcConfiguration {
5151
@Bean
5252
public ApplicationListener<?> idSetting() {
5353

54-
return (ApplicationListener<BeforeSaveEvent>) event -> {
54+
return (ApplicationListener<BeforeConvertEvent>) event -> {
5555

5656
if (event.getEntity() instanceof LegoSet) {
5757
setIds((LegoSet) event.getEntity());

0 commit comments

Comments
 (0)