GeoLatte / geolatte-geom

A geometry model that conforms to the OGC Simple Features for SQL specification.
Other
134 stars 63 forks source link

Geometry is not Serializable #34

Closed negesti closed 8 years ago

negesti commented 8 years ago

I hava a project using hibernate-spatial. With hibernate 5.0 the spatial project is a component in hibernate-orm and they use geolatte-geom. The Geometry object implements Serializable but can not be serialized when inside an hibernate Entity because not all properties can be serialized:

Using com.vividsolutions.jts.geom.Geometry (which was serializable) does not work either. Hibernate uses the PointSequenceCoordinateSequenceFactory which is not serializable.

maesenka commented 8 years ago

I started adding 'Serializable' every where but I realized it is not a good solution. I'm going to add full serialization using writeObject/readObject in the root Geometry class.

negesti commented 8 years ago

For the actual data processing (activemq) i just serialize the Coordinate which are Serializable "out of the box" but I had to add Serialize at serveral point to get the spring-batch HibernateCursorItemReader running and accecpting the (Oralce) SDO_GEOMETRY data.

A "real" write/readObject would be the nice and most likely the fastet.

maesenka commented 8 years ago

This should now be resolved by commit 93d1fedd0bea72d406a1c0a133586b3904b18c1c

wafath commented 8 years ago

I am still having this issue with the PointSequenceCoordinateSequenceFactory in Hibernate Spatial 5.2.1 and geolatte-geom 1.0.3. Could the factories be made transient?

maesenka commented 8 years ago

This should now be resolved by commit 58baa6369f0fe671d53b7684be2a425f42e53c70.

This is released in version 1.0.5