SAP / olingo-jpa-processor-v4

The JPA Processor fills the gap between Olingo V4 and the database, by providing a mapping between JPA metadata and OData metadata, generating queries and supporting the entity manipulations.
Apache License 2.0
122 stars 76 forks source link

Geospatial datatype and converter #222

Closed sahashmi closed 10 months ago

sahashmi commented 10 months ago

I have Odata4 service based on this tech stack:

Spring Boot 2.7.14 Java 8 Apache Olingo 4.9.0 SAP JPA Processor 1.0.9 Eclipselink 2.7.13 PostgreSQL

I am using Geospatialcollection data type in my JPA Entity where I wrote a custom EclipseLink converter (org.eclipse.persistence.mappings.converters.converter) that converts Geospatialcollection data type input to PGObject type to save data in PostgreSQL. When I read the table I get following error:

2023-08-30 16:08:01.348 DEBUG 7060 --- [nio-8080-exec-3] c.s.o.j.processor.cb.impl.TypeConverter : No converter found to convert PGobject to GeospatialCollection

Looking at the code it appears AttributeConverter<X,Y> is supported to read data, however I couldn't apply another converter on the same field, applying both resulting another converter didn't work.

Could you explain what is the solution? Do we have to add PGObject to Geospatialcollection conversion in TypeConverter.java ?