Skip to content

Commit 52d2257

Browse files
committed
Adapt R2dbcTypes to R2dbcType renaming
[pgjdbc#378]
1 parent b369ae8 commit 52d2257

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
<postgresql.version>42.2.18</postgresql.version>
4848
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
4949
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
50-
<r2dbc-spi.version>0.9.0-BIND-PARAMS-SNAPSHOT</r2dbc-spi.version>
50+
<r2dbc-spi.version>0.9.0.BUILD-SNAPSHOT</r2dbc-spi.version>
5151
<reactor.version>Dysprosium-SR12</reactor.version>
5252
<scram-client.version>2.1</scram-client.version>
5353
<spring-framework.version>5.2.9.RELEASE</spring-framework.version>

src/main/java/io/r2dbc/postgresql/codec/DefaultCodecs.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import io.r2dbc.postgresql.message.Format;
2323
import io.r2dbc.postgresql.util.Assert;
2424
import io.r2dbc.spi.Parameter;
25-
import io.r2dbc.spi.R2dbcTypes;
25+
import io.r2dbc.spi.R2dbcType;
2626
import io.r2dbc.spi.Type;
2727
import reactor.util.annotation.Nullable;
2828

@@ -178,9 +178,9 @@ public EncodedParameter encode(Object value) {
178178
return encodeNull(parameter.getType().getJavaType());
179179
}
180180

181-
if (parameter.getType() instanceof R2dbcTypes) {
181+
if (parameter.getType() instanceof R2dbcType) {
182182

183-
PostgresqlObjectId targetType = PostgresqlObjectId.valueOf((R2dbcTypes) parameter.getType());
183+
PostgresqlObjectId targetType = PostgresqlObjectId.valueOf((R2dbcType) parameter.getType());
184184
dataType = targetType;
185185
}
186186

src/main/java/io/r2dbc/postgresql/codec/PostgresqlObjectId.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import io.r2dbc.postgresql.api.RefCursor;
2020
import io.r2dbc.postgresql.util.Assert;
2121
import io.r2dbc.spi.Clob;
22-
import io.r2dbc.spi.R2dbcTypes;
22+
import io.r2dbc.spi.R2dbcType;
2323
import io.r2dbc.spi.Type;
2424

2525
import java.math.BigDecimal;
@@ -462,15 +462,15 @@ public static PostgresqlObjectId valueOf(int objectId) {
462462
}
463463

464464
/**
465-
* Returns the {@link PostgresqlObjectId} matching a given {@link R2dbcTypes R2DBC type}.
465+
* Returns the {@link PostgresqlObjectId} matching a given {@link R2dbcType R2DBC type}.
466466
*
467467
* @param type the R2DBC type
468468
* @return the {@link PostgresqlObjectId}
469469
* @throws IllegalArgumentException if {@code type} is {@code null}
470470
* @throws UnsupportedOperationException if the given {@code type} is not supported
471471
* @since 0.9
472472
*/
473-
public static PostgresqlObjectId valueOf(R2dbcTypes type) {
473+
public static PostgresqlObjectId valueOf(R2dbcType type) {
474474

475475
Assert.requireNonNull(type, "type must not be null");
476476

src/test/java/io/r2dbc/postgresql/AbstractCodecIntegrationTests.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
import io.r2dbc.spi.Clob;
3636
import io.r2dbc.spi.Connection;
3737
import io.r2dbc.spi.Parameters;
38-
import io.r2dbc.spi.R2dbcTypes;
38+
import io.r2dbc.spi.R2dbcType;
3939
import io.r2dbc.spi.Type;
4040
import org.assertj.core.data.Offset;
4141
import org.junit.jupiter.api.Test;
@@ -109,9 +109,9 @@ void bigDecimal() {
109109
testCodec(BigDecimal.class, new BigDecimal("100"), "INT8");
110110
testCodec(BigDecimal.class, new BigDecimal("100"), "FLOAT4");
111111
testCodec(BigDecimal.class, new BigDecimal("100"), "FLOAT8");
112-
testCodec(BigDecimal.class, new BigDecimal("100"), "NUMERIC", R2dbcTypes.NUMERIC);
113-
testCodec(BigDecimal.class, new BigDecimal("100"), "FLOAT8", R2dbcTypes.DOUBLE);
114-
testCodec(BigDecimal.class, new BigDecimal("100"), "INT8", R2dbcTypes.BIGINT);
112+
testCodec(BigDecimal.class, new BigDecimal("100"), "NUMERIC", R2dbcType.NUMERIC);
113+
testCodec(BigDecimal.class, new BigDecimal("100"), "FLOAT8", R2dbcType.DOUBLE);
114+
testCodec(BigDecimal.class, new BigDecimal("100"), "INT8", R2dbcType.BIGINT);
115115
}
116116

117117
@Test
@@ -230,9 +230,9 @@ void doublePrimitive() {
230230
testCodec(Double.class, 100.1, "FLOAT4");
231231
testCodec(Double.class, 100.1, "FLOAT8");
232232

233-
testCodec(Double.class, 100.1, "DECIMAL", R2dbcTypes.DECIMAL);
234-
testCodec(Double.class, 100.1, "FLOAT4", R2dbcTypes.FLOAT);
235-
testCodec(Double.class, 100.1, "FLOAT8", R2dbcTypes.DOUBLE);
233+
testCodec(Double.class, 100.1, "DECIMAL", R2dbcType.DECIMAL);
234+
testCodec(Double.class, 100.1, "FLOAT4", R2dbcType.FLOAT);
235+
testCodec(Double.class, 100.1, "FLOAT8", R2dbcType.DOUBLE);
236236
}
237237

238238
@Test
@@ -249,9 +249,9 @@ void floatPrimitive() {
249249
testCodec(Float.class, 100.1f, "FLOAT4");
250250
testCodec(Float.class, 100.1f, "FLOAT8");
251251

252-
testCodec(Float.class, 100.1f, "DECIMAL", R2dbcTypes.DECIMAL);
253-
testCodec(Float.class, 100.1f, "FLOAT4", R2dbcTypes.FLOAT);
254-
testCodec(Float.class, 100.1f, "FLOAT8", R2dbcTypes.DOUBLE);
252+
testCodec(Float.class, 100.1f, "DECIMAL", R2dbcType.DECIMAL);
253+
testCodec(Float.class, 100.1f, "FLOAT4", R2dbcType.FLOAT);
254+
testCodec(Float.class, 100.1f, "FLOAT8", R2dbcType.DOUBLE);
255255
}
256256

257257
@Test
@@ -289,13 +289,13 @@ void intPrimitive() {
289289
testCodec(Integer.class, 100, "FLOAT4");
290290
testCodec(Integer.class, 100, "FLOAT8");
291291

292-
testCodec(Integer.class, 100, "INT2", R2dbcTypes.SMALLINT);
293-
testCodec(Integer.class, 100, "INT4", R2dbcTypes.INTEGER);
294-
testCodec(Integer.class, 100, "INT8", R2dbcTypes.INTEGER);
292+
testCodec(Integer.class, 100, "INT2", R2dbcType.SMALLINT);
293+
testCodec(Integer.class, 100, "INT4", R2dbcType.INTEGER);
294+
testCodec(Integer.class, 100, "INT8", R2dbcType.INTEGER);
295295
testCodec(Integer.class, 100, "OID");
296-
testCodec(Integer.class, 100, "NUMERIC", R2dbcTypes.NUMERIC);
297-
testCodec(Integer.class, 100, "FLOAT4", R2dbcTypes.FLOAT);
298-
testCodec(Integer.class, 100, "FLOAT8", R2dbcTypes.DOUBLE);
296+
testCodec(Integer.class, 100, "NUMERIC", R2dbcType.NUMERIC);
297+
testCodec(Integer.class, 100, "FLOAT4", R2dbcType.FLOAT);
298+
testCodec(Integer.class, 100, "FLOAT8", R2dbcType.DOUBLE);
299299
}
300300

301301
@Test

0 commit comments

Comments
 (0)