Overwriting existing spatial type

I have a custom Oracle Hibernate Dialect with a custom Oracle spatial type. This type is supposed to replace the standard SDOGeometryType. The purpose of this custom type is to handle complex arcs in Oracle. This worked well on Springboot 2 and Hibernate 5.

Now I am upgrading this to Springboot 3.4.2 with Hibernate (Spatial) 6.6.5.Final I deleted the custom Dialect and created a TypeContributor and registered it in a file named org.hibernate.boot.model.TypeContributor under META-INF/services

I have an ExtendedSDOGeometryType class that implements JdbcType. It has a ExtendedSDOGeometryValueBinder and a ExtendedSDOGeometryValueExtractor. Plus a class ExtendedOracleJDBCTypeFactory that extends OracleJDBCTypeFactory

I see that these classes are loaded and registered/contributed during application startup. But they seem to get overwritten by the default geometry type SDOGeometryType. The OracleDialectContributor and ContributorImplementer are registering the default SDOGeometryType under the same keys as my custom type (Geometry) During runtime, I see that save actions are being handled by the default SDOGeometryValueBinder.

Is there a way that I can disable the default SDOGeometryType? How can I guarantee that my custom type does not get overwritten by the default type? Can I postpone the serviceloading of my TypeContributor in some way?

A very similar question was asked recently: How to overwrite spatial function descriptors - #4 by Marko
Please read the discussion first.

Hi Christian
Thanks for your reply
I noticed the ordinal() function in the FunctionContributor
However, the TypeContributor doesn’t have an ordinal() function
Maybe this ordinal mechanism can also be added to the Type contributions?

Please go ahead and create an improvement ticket in our issue tracker for this. If you want, you can also try to implement this as a contribution :slight_smile:

Thanks!
We’ll create a ticket and start working on a contribution

1 Like

I have created ticket https://hibernate.atlassian.net/browse/HHH-19247
And we have started working on a contribution.

1 Like