-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: hbm2ddl.auto=validate and mdsys.sdo_geometry ???
PostPosted: Sun Feb 06, 2011 8:03 am 
Newbie

Joined: Wed Oct 19, 2005 9:29 am
Posts: 5
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


Top
 Profile  
 
 Post subject: Re: hbm2ddl.auto=validate and mdsys.sdo_geometry ???
PostPosted: Wed Feb 09, 2011 12:08 pm 
Newbie

Joined: Wed Oct 19, 2005 9:29 am
Posts: 5
Although I think this is in the correct forum - maybe someone could move it if not. I still got the problem and I don't have an idea how to get this to work. I would even "fix" that by myself if someone could give me a hint where I can hack some kind of workaround in.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.