I was having this exact same problem. Manually adding a Hibernate @TypeDef
annotation for the geometry type seems to have worked for me. For whatever reason envers does not automatically pick up the GeometryType
mapping even though Hibernate core does. So for our application, I have:
@Entity
@Audited
@Table(name = "geo_element")
@ForeignKey(name = "FK_geo_element__id__element")
@TypeDef(name = "geometry", typeClass = GeometryType.class)
public class GeoElement extends Element {
@Type(type = "geometry")
@Column(name = "data")
private Point data;
//...
}
We are using Hibernate 4.1 with Hibernate Spatial 4.0-M1 running on top of Spring 3.1.3 and configured using Spring's LocalSessionFactoryBean.