It is very cumbersome to use custom dialects which are extending OracleSpatial10gDialect. Consider MyOracleSpatial10gDialect as a sub-class of OracleSpatial10gDialect.
public class MyOracleSpatial10gDialect extends OracleSpatial10gDialect {
public MyOracleSpatial10gDialect() {
super();
registerHibernateType(Types.ARRAY, "array");
}
}
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
:
<property name="hibernate.dialect" value="foo.bar.MyOracleSpatial10gDialect"/>
But during initialisation then, the SpatialDialectFactory destroys my dream. |