When using Geometry types with Hibernate Spatial and MySQL 5.6+, the official manual recommends using MySQL56SpatialDialect and MySQL56InnoDBSpatialDialect (there are some typos in the manual).
However, when using either of the two classes as the dialect of Hibernate, Hibernate will fail to choose the correct serializer to parse the binary Geometry data. In fact, the associations between the SQL geometry type and the corresponding are not registered at all, which should be done in contributeTypes method. These two classes has not overridden this method yet.
Here is an example of this situation:
And I insert a row into the database:
When I try to fetch the row by Hibernate with the dialect MySQL56InnoDBSpatialDialect, it fails with:
Hibernate 5.1.0 with hibernate-java8 and hibernate-spatial
Database: MySQL 5.6.21 under Windows (32 bit)
To add, we are also not able to serialise (save new entities to the DB) because of the same issue, so the dialect seems completely broken at the moment.