Browse Source

Consider JTS geometry types as simple types.

Original pull request: #1713
Closes #1711
pull/1724/head
Pete Setchell 2 years ago committed by Mark Paluch
parent
commit
ebdbe047d4
No known key found for this signature in database
GPG Key ID: 55BC6374BAA9D973
  1. 12
      spring-data-r2dbc/src/main/java/org/springframework/data/r2dbc/dialect/PostgresDialect.java

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

@ -58,6 +58,18 @@ public class PostgresDialect extends org.springframework.data.relational.core.di @@ -58,6 +58,18 @@ public class PostgresDialect extends org.springframework.data.relational.core.di
"io.r2dbc.postgresql.codec.Polygon") //
.forEach(s -> ifClassPresent(s, simpleTypes::add));
// support the native JTS types supported by r2dbc-postgresql
Stream.of("org.locationtech.jts.geom.Geometry", //
"org.locationtech.jts.geom.Point", //
"org.locationtech.jts.geom.MultiPoint", //
"org.locationtech.jts.geom.LineString", //
"org.locationtech.jts.geom.LinearRing", //
"org.locationtech.jts.geom.MultiLineString", //
"org.locationtech.jts.geom.Polygon", //
"org.locationtech.jts.geom.MultiPolygon", //
"org.locationtech.jts.geom.GeometryCollection") //
.forEach(s -> ifClassPresent(s, simpleTypes::add));
// conditional Postgres JSON support.
ifClassPresent("io.r2dbc.postgresql.codec.Json", simpleTypes::add);

Loading…
Cancel
Save