Search code examples
javahibernateoracle11goracle-spatialhibernate-spatial

Is it possible to read the Z component of a SDO_POINT using Hibernate-Spatial over Oracle?


I am using Hibernate-Spatial to map a com.vividsolutions.jts.geom.Point field in an entity to an SDO_POINT field in my Oracle 11g table.

The column on the table is defined as :

"SST_COORDINATES" "MDSYS"."SDO_GEOMETRY"

The column is mapped as :

@Type(type = "org.hibernate.spatial.GeometryType")
@Column(name = "SST_COORDINATES")
@QueryType(PropertyType.NONE)
private Point coordinates;

(The @QueryType annotation is from QueryDSL so probably not relevant, but I included it for the sake of completeness)

Here is an example of content for the SDO_POINT column (as seen in SQLDeveloper) :

MDSYS.SDO_GEOMETRY(3001,21781,MDSYS.SDO_POINT_TYPE(649300,246800,399.4),NULL,NULL)

It all works fine except that I can't read the Z component of the point. The Point class only has getX() and getY() accessors.

I tried to access the underlying org.hibernate.spatial.jts.mgeom.MCoordinate object, via the method getCoordinate(), but the Z value is equal to the Y value.

Can anybody help me get the Z value using Hibernate-Spatial ? Or is it just not supported ?


Solution

  • After some more research I found the bug causing this and files the following JIRA issue : http://www.hibernatespatial.org/jira/browse/HIBSPA-117

    It will be fixed in a future release.