I recently discovered the potential of using JTS library when dealing with geographic types within a project. I'm using hibernate as my ORM (including hibernate spatial).
Before knowing the existence of JTS, I stored coordinates in a custom class called LatLon; whenever I wanted to manage polylines, I created a list of them, e.g. List. I realised how bad it was, speaking in terms of performance when making CRUD operations in the database.
So, as I've told you before, I discovered that my LatLon class could be replaced by the JTS' Point class. I'm starting to implement it and replacing the LatLon attributes, but I've several questions:
I map my classes using XML (not annotations). Is the following correct?
(Java class)
... private Point puntoInicio; ...
(XML mapping)
<property name="puntoInicio" type="org.hibernate.spatial.GeometryType" column="RUTA_PUNTOINICIO" not-null="true" />
How do I store Polylines? I haven't found any data type with the name of Polyline. However, I've found others like LineString. Could I use this to represent polylines? How do I map them?
Thank you so much!
Edit: I'm using Hibernate 5.0.7.Final + Hibernate Spatial 5.0.7.Final
Edit 2: Sorry for my delay and for not accepting any answer. I undid the whole modifications some time ago, but I want to modify and implement this way. Thank you for your time and your patience.