Hibernate version:3.0
Has anyone figured out how to create a hibernate mapping file for mapping between oracle.spatial.geometry.JGeometry and an SDO_Geometry? Haven't been able to figure out how to do it with UserTypes
for instance I'd like to create a simple class something like the following:
import oracle.spatial.geometry.JGeometry;
public class Building {
private Long id;
private String label;
private oracle.spatial.geometry.JGeometry shape;
public Building() {}
.....
with a corresponding hibernate mapping file that would contain something like:
<hibernate-mapping>
<class name="Building" table="BUILDING">
<id name="id" column="ID" type="long">
<generator class="native"/>
</id>
<property name="label" type="string" length="100"/>
<property name="shape" type="JGeometry"/>
</class>
</hibernate-mapping>
that would create a table like what that produced by the following SQL:
CREATE TABLE Buildings (
id NUMBER PRIMARY Key,
label VARCHAR(100),
shape SDO_GEOMETRY)
storage (initial 1m);
Of course JGeometry is not a supported type and hibernate doesn't know anything about the SDO_Geometry. Does anyone know of a strategy to use or examples of how to do this?
|