Hi,
I'm using oracle (10g and 11g) to store some geodata as MDSYS.SDO_GEOMETRY and create the schema via hbm2ddl. My entitycode looks like this:
Code:
@Entity
...
public class XYZ {
...
@Type(type = "org.hibernatespatial.GeometryUserType")
private Geometry point;
...
}
and the SQL looks like this:
Code:
create table XYZ (
...
point MDSYS.SDO_GEOMETRY,
...);
This is perfect and works as i would like to have it. But there is a problem when I set the attribute "hbm2ddl.auto=validate". Oracle will send "sdo_geometry" as datatype and not "MDSYS.SDO_GEOMETRY". Hibernate will not except the schema as valid.
So I did that:
Code:
@Entity
...
public class XYZ {
...
@Type(type = "org.hibernatespatial.GeometryUserType")
@Column(columnDefinition = "sdo_geometry")
private Geometry point;
...
}
SQL:
Code:
create table XYZ (
...
point sdo_geometry,
...);
And this is also correct as oracle got a synonym "SDO_GEOMETRY" to the "MDSYS.SDO_GEOMETRY" in the users schema. everything could be fine now :-( But we got another software that is using the same schema. It doesn't work when the datatype isn directly referncing the MDSYS-schema. We can not edit this software and so I'm forced to somehow create the column as "MDSYS.SDO_GEOMETRY" and tell hibernate that "MDSYS.SDO_GEOMETRY" is the same as "sdo_geometry". Does anybode got an idea how I can handle this?
Thank you =)
org.hibernatespatial.hibernate-spatial-oracle - 0.9.2
org.hibernate.hibernate-annotations - 3.4.0.GA
org.hibernate.hibernate-commons-annotations - 3.1.0.GA
org.hibernate.hibernate-validator - 3.1.0.GA