CREATE TABLE example (
id BIGSERIAL PRIMARY KEY,
location GEOGRAPHY(POINT, 4326) NOT NULL
);
fun createExample(location: Location): ExampleRecord {
return dbSessionManager.session()
.insertInto(EXAMPLE)
.set(EXAMPLE.LOCATION, location.convertToPoint())
.returning()
.fetchOne()
}
fun getExampleByLocation(location: Location): ExampleRecord? {
return dbSessionManager.session()
.selectFrom(EXAMPLE)
.where(EXAMPLE.LOCATION.eq(location.convertToPoint()))
.limit(1)
.fetchOne()
}
fun getExampleInRadius(location: Location, radius: Double):ExampleRecord? {
val routine = StDwithin3()
routine.set__1(EXAMPLE.LOCATION)
routine.set__2(location.convertToPoint())
routine.set__3(radius)
return dbSessionManager.session()
.selectFrom(EXAMPLE)
.where(routine.asField())
.limit(1)
.fetchOne()
}
org.jooq.exception.DataAccessException: SQL [select "public"."example"."id", "public"."example"."location" from "public"."example" where "postgis"."st_dwithin"(cast("public"."example"."location" as USER-DEFINED), cast(?::geography as USER-DEFINED), cast(? as double precision)) limit ?]; ERROR: syntax error at or near "USER"
--
You received this message because you are subscribed to the Google Groups "jOOQ User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jooq-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.