Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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", //
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is sufficient to just add Geometry as the other types are subclasses and therefore considered simple types.

"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);

Expand Down