Got the solution.
We need following jar files:
hibernate-spatial-1.1.1.jar (New)
hibernate-spatial-mysql-1.1.1.jar (New)
jts-1.12.jar (New)
Now, we should declare the location property as following:
@Type(type="org.hibernatespatial.GeometryUserType")
@Column(columnDefinition="Point")
public com.vividsolutions.jts.geom.Point location;
That is it.
We have our property defined with proper JPA - Hibernet - SQL mapping.
How to create the object of com.vividsolutions.jts.geom.Point class is
also interesting.
It should be done as follows:
GeometryFactory factory = new GeometryFactory();
com.vividsolutions.jts.geom.Point point = factory.createPoint(new
Coordinate(longitude, latitude));
And we are good to go.
-- Cheers !!