@Configuration
public class R2dbcConfig {
@Bean
public R2dbcCustomConversions r2dbcCustomConversions() {
List<Object> converters = new ArrayList<>();
converters.add(new ChatRoomTypeReadingConverter());
converters.add(new ChatRoomTypeWritingConverter());
// Pass PostgresDialect.INSTANCE as the first parameter
return R2dbcCustomConversions.of(PostgresDialect.INSTANCE, converters);
}
@Bean
public CodecRegistrar enumCodecRegistrar() {
return EnumCodec.builder()
.withEnum("chat_room_type", ChatRoomType.class)
.withEnum("chat_room_visibility", ChatRoomVisibility.class)
.withEnum("chat_room_member_role", ChatRoomMemberRole.class)
.withEnum("notification_preference", NotificationPreference.class)
.withEnum("gender", Gender.class)
.build();
}
}
@Configuration
public class R2dbcConfig {
@Bean
public R2dbcCustomConversions r2dbcCustomConversions() {
List<Object> converters = new ArrayList<>();
converters.add(new ChatRoomTypeReadingConverter());
converters.add(new ChatRoomTypeWritingConverter());
// Pass PostgresDialect.INSTANCE as the first parameter
return R2dbcCustomConversions.of(PostgresDialect.INSTANCE, converters);
}
@Bean
public CodecRegistrar enumCodecRegistrar() {
return EnumCodec.builder()
.withEnum("chat_room_type", ChatRoomType.class)
.withEnum("chat_room_visibility", ChatRoomVisibility.class)
.withEnum("chat_room_member_role", ChatRoomMemberRole.class)
.withEnum("notification_preference", NotificationPreference.class)
.withEnum("gender", Gender.class)
.build();
}
}