It is very cumbersome to use custom dialects which are extending OracleSpatial10gDialect. Consider MyOracleSpatial10gDialect as a sub-class of OracleSpatial10gDialect.
Due to the nature of buildDialect() in the SpatialDialectFactory, MyOracleSpatial10gDialect will pass the test if (dialect instanceof OracleSpatial10gDialect) which will result in a new object of the parent class OracleSpatial10gDialect. This is bad. This way all custom attributes, like additional type mappings, of MyOracleSpatial10gDialect "get lost".
In my persistence unit I specify this custom dialect which is used correctly:
But during initialisation then, the SpatialDialectFactory destroys my dream.
Java 1.8 x64, Oracle 12