-
Couldn't load subscription status.
- Fork 377
Closed as not planned
Description
Hello Guys,
I'm using enumeration of postgresql with spring data r2dbc , i followed the documentation to register the custom converter, but the save is failing with an error of : java.lang.IllegalArgumentException: Cannot encode parameter of type com.example.r2dbc.Mode (AUTOMATIC)
Here is the converter
@WritingConverter
public class ModeConverter implements Converter<Mode, Mode> {
@Override
public Mode convert(@NonNull Mode pricingMode) {
return pricingMode;
}
}Here is the configuration class
@Configuration
@AllArgsConstructor
public class R2dbcConfiguration extends AbstractR2dbcConfiguration {
private final ConnectionFactory connectionFactory;
@Override
@NonNull
public ConnectionFactory connectionFactory() {
return connectionFactory;
}
@Override
@NonNull
protected List<Object> getCustomConverters() {
return List.of(new ModeConverter());
}
}I created an example of project with tests : r2dbc.zip
Thank you for your help
Metadata
Metadata
Assignees
Labels
No labels