Hi Lukas,
I am trying to use the Binding and Converter you wrote. While it works fine
for reading the postgis geography type from the database, I did not manage
to use it for writing.
The following code
final ShipmentRecord shipmentRecord =
create.newRecord(SHIPMENT, actualNewShipment);
shipmentRecord.reset(SHIPMENT.ID);
shipmentRecord.store();
Results in this error:
xpatron> org.jooq.exception.SQLDialectNotSupportedException: Type class
org.postgis.PGgeometry is not supported in dialect POSTGRES
xpatron> at
org.jooq.impl.DefaultDataType.getDataType(DefaultDataType.java:803)
xpatron> at
org.jooq.impl.DefaultDataType.getDataType(DefaultDataType.java:747)
xpatron> at org.jooq.impl.DefaultBinding.toSQLCast(DefaultBinding.java:369)
xpatron> at org.jooq.impl.DefaultBinding.sql(DefaultBinding.java:268)
xpatron> at org.jooq.impl.Val.accept(Val.java:83)
xpatron> at
org.jooq.impl.DefaultRenderContext.visit0(DefaultRenderContext.java:396)
xpatron> at org.jooq.impl.AbstractContext.visit0(AbstractContext.java:394)
xpatron> at org.jooq.impl.AbstractContext.visit(AbstractContext.java:159)
xpatron> at
org.jooq.impl.FieldMapForInsert.accept(FieldMapForInsert.java:83)
xpatron> at
org.jooq.impl.DefaultRenderContext.visit0(DefaultRenderContext.java:396)
xpatron> at org.jooq.impl.AbstractContext.visit0(AbstractContext.java:394)
xpatron> at org.jooq.impl.AbstractContext.visit(AbstractContext.java:159)
xpatron> at
org.jooq.impl.FieldMapsForInsert.accept(FieldMapsForInsert.java:90)
xpatron> at
org.jooq.impl.DefaultRenderContext.visit0(DefaultRenderContext.java:396)
xpatron> at org.jooq.impl.AbstractContext.visit0(AbstractContext.java:394)
xpatron> at org.jooq.impl.AbstractContext.visit(AbstractContext.java:159)
xpatron> at
org.jooq.impl.InsertQueryImpl.toSQLInsert(InsertQueryImpl.java:407)
xpatron> at org.jooq.impl.InsertQueryImpl.accept0(InsertQueryImpl.java:317)
xpatron> at org.jooq.impl.AbstractDMLQuery.accept(AbstractDMLQuery.java:185)
xpatron> at
org.jooq.impl.DefaultRenderContext.visit0(DefaultRenderContext.java:396)
xpatron> at org.jooq.impl.AbstractContext.visit0(AbstractContext.java:394)
xpatron> at org.jooq.impl.AbstractContext.visit(AbstractContext.java:159)
xpatron> at org.jooq.impl.AbstractQuery.getSQL0(AbstractQuery.java:481)
xpatron> at org.jooq.impl.AbstractQuery.execute(AbstractQuery.java:307)
xpatron> at
org.jooq.impl.TableRecordImpl.storeInsert0(TableRecordImpl.java:184)
xpatron> at
org.jooq.impl.TableRecordImpl$1.operate(TableRecordImpl.java:155)
xpatron> at org.jooq.impl.RecordDelegate.operate(RecordDelegate.java:128)
xpatron> at
org.jooq.impl.TableRecordImpl.storeInsert(TableRecordImpl.java:151)
xpatron> at
org.jooq.impl.UpdatableRecordImpl.store0(UpdatableRecordImpl.java:195)
xpatron> at
org.jooq.impl.UpdatableRecordImpl.access$000(UpdatableRecordImpl.java:85)
xpatron> at
org.jooq.impl.UpdatableRecordImpl$1.operate(UpdatableRecordImpl.java:135)
xpatron> at org.jooq.impl.RecordDelegate.operate(RecordDelegate.java:128)
xpatron> at
org.jooq.impl.UpdatableRecordImpl.store(UpdatableRecordImpl.java:131)
xpatron> at
org.jooq.impl.UpdatableRecordImpl.store(UpdatableRecordImpl.java:123)
xpatron> at
eu.m2machine.xpatron.transport.service.ShipmentDAO.create(ShipmentDAO.java:66)
xpatron> at
eu.m2machine.xpatron.transport.service.ShipmentService.create(ShipmentService.java:52)
xpatron> at
eu.m2machine.xpatron.transport.rest.ShipmentREST.doReturning(ShipmentREST.java:235)
xpatron> at
eu.m2machine.xpatron.transport.rest.ShipmentREST.createReturning(ShipmentREST.java:219)
xpatron> at
eu.m2machine.xpatron.transport.rest.ShipmentREST.lambda$createShipment$4(ShipmentREST.java:152)
xpatron> at
io.vertx.core.impl.ContextImpl.lambda$executeBlocking$17(ContextImpl.java:296)
xpatron> at
io.vertx.core.impl.OrderedExecutorFactory$OrderedExecutor.lambda$new$265(OrderedExecutorFactory.java:91)
xpatron> at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
xpatron> at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
xpatron> at java.lang.Thread.run(Thread.java:745)
The code of the converter's to() method is:
@Override
public Object to(Position position) {
if (position == null) {
return null;
}
Point p = new Point(position.getLatitude(), position.getLatitude());
p.setSrid(SPATIAL_REF_SYS);
return new PGgeometry(p);
}
No method of the binding seems to be called at the call that fails.
Any idea what you cause this problem?
Kind regards,
Matthias
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.