Closed FDN73 closed 4 years ago
I forgot to specify that the error is triggered enabling SDO POINT usage: System.setProperty(Features.USE_SDO_POINT, "true");
Here a complete unit test (taken from a Spring Boot application, but the ConnectionFinder can be overridden to explicitly connect to Oracle):
@Test
public void testUseSDOPoint() throws SQLException
{
CoordinateReferenceSystem<G3D> wgs84z = CoordinateReferenceSystems.addVerticalSystem(CoordinateReferenceSystems.WGS84, G3D.class,
LinearUnit.METER);
org.geolatte.geom.Point<G3D> point = DSL.point(wgs84z, DSL.g(49.0,15.0,0.0d));
System.setProperty(Features.USE_SDO_POINT, "true");
SDOGeometry sdoGeometry = Encoders.encode(point);
Struct struct = new OracleJDBCTypeFactory(new ConnectionFinder()
{
@Override
public Connection find(Connection conn)
{
try
{
return dataSource.getConnection();
}
catch (SQLException ex)
{
System.error(ex.toString());
}
return null;
}
}).createStruct(sdoGeometry, ds.getConnection());//**Here will fail **
org.geolatte.geom.Geometry decoded = Decoders.decode(struct);
assertEquals(point, decoded);
}
Ok, I have updated the geolatte version (the one shipped with my version of Hibernate Spatial is 1.3) and by looking at the sources, this is already fixed. Closing.
Hello, given this example entity:
When persisted, it will give this error:
java.lang.ArrayStoreException: java.lang.Double
I traced the error to the createStruct method of the OracleJDBCTypeFactory class, in particular this section:
I reproduced the issue with this simple code (copying the required methods from the mentioned class):
In this case, a code that would work is:
Any thoughts?