I am developing an location app with oracle spatial in Java. I am using hibernate 4.0 spatial for orm layer. I am new in spatial and i couldn't find best practise for hibernate spatial. My database model following;
CREATE TABLE SYSTEM.POI (
POI_ID INTEGER,
SERVICE_ID INTEGER,
POI_NAME VARCHAR2(255 CHAR),
DESCRIPTION VARCHAR2(1023 CHAR),
CATEGORY VARCHAR2(127 CHAR),
ADDRESS VARCHAR2(4000 CHAR),
MOBILE_PHONE VARCHAR2(15 CHAR),
FIXED_PHONE VARCHAR2(15 CHAR),
BUSINESS_HOURS VARCHAR2(1023 CHAR),
SHAPE SDO_GEOMETRY
)
insert statement is following;
INSERT INTO SYSTEM.POI (SERVICE_ID, POI_NAME, DESCRIPTION, CATEGORY, ADDRESS, MOBILE_PHONE, FIXED_PHONE, BUSINESS_HOURS, SHAPE)
VALUES(
'1320',
'PO-Kral Petrol Ürünleri San ve Tic. Ltd. şti.',
'Camilerimiz',
'CAMI',
'İSLİCE MAHALLESİ DERE SOKAK NO:5',
'2762151093',
'5552552343',
'Hafta içi 09:00 - 17:00, haftasonu 09:00 - 13:00 açık',
SDO_GEOMETRY(
2001,
3785,
SDO_POINT_TYPE(28.90762, 41.1521, NULL),
NULL,
NULL
)
);
entity model is following i'm sharing just sdo_geometry object;
import com.vividsolutions.jts.geom.Geometry;
...
@Column(name="SHAPE")
@Type(type = "org.hibernatespatial.GeometryUserType")
private Geometry shape;
public Geometry getShape() {
return shape;
}
public void setShape(Geometry shape) {
this.shape = shape;
}
How can i fill this spahe object with dynamic parameters. For example;
SDO_GEOMETRY(
2001, --> sdo_gtype
3785, --> sdo_srid
SDO_POINT_TYPE(28.90762, 41.1521, NULL), --> sdo_point
NULL, --> sdo_elem_info
NULL --> sdo_ordinates
)
How to pass sdo_gtype,sdo_srid,sdo_point_type parameters to geometry object dynamically?