Skip to content

Commit ebdbe04

Browse files
pete-setchell-kubramp911de
authored andcommitted
Consider JTS geometry types as simple types.
Original pull request: #1713 Closes #1711
1 parent 5647835 commit ebdbe04

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

spring-data-r2dbc/src/main/java/org/springframework/data/r2dbc/dialect/PostgresDialect.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,18 @@ public class PostgresDialect extends org.springframework.data.relational.core.di
5858
"io.r2dbc.postgresql.codec.Polygon") //
5959
.forEach(s -> ifClassPresent(s, simpleTypes::add));
6060

61+
// support the native JTS types supported by r2dbc-postgresql
62+
Stream.of("org.locationtech.jts.geom.Geometry", //
63+
"org.locationtech.jts.geom.Point", //
64+
"org.locationtech.jts.geom.MultiPoint", //
65+
"org.locationtech.jts.geom.LineString", //
66+
"org.locationtech.jts.geom.LinearRing", //
67+
"org.locationtech.jts.geom.MultiLineString", //
68+
"org.locationtech.jts.geom.Polygon", //
69+
"org.locationtech.jts.geom.MultiPolygon", //
70+
"org.locationtech.jts.geom.GeometryCollection") //
71+
.forEach(s -> ifClassPresent(s, simpleTypes::add));
72+
6173
// conditional Postgres JSON support.
6274
ifClassPresent("io.r2dbc.postgresql.codec.Json", simpleTypes::add);
6375

0 commit comments

Comments
 (0)