-->
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.  [ 1 post ] 
Author Message
 Post subject: How to use Hibernate with Oracle 9 Spatial geometries?
PostPosted: Fri Sep 10, 2004 9:54 am 
Newbie

Joined: Fri Sep 10, 2004 9:36 am
Posts: 1
Hibernate version: 2.1.6

Name and version of the database you are using: Oracle 9.2.0.5 Spatial

Hello,

I'm fairly new to Hibernate and read basically that it is possible to have custom UserTypes.
Nevertheless I wondered if anyone in this forum already has implemented a UserType for the Oracle spatial geometry objects.

There are two interesting types:

oracle.spatial.geometry.JGeometry which is the concrete usable geometry and oracle.sql.STRUCT which you can obtain from the database and convert it to JGeometry.

When using direct SQL you could use (from the Oracle Spatial JavaDoc):

/// reading a geometry from database
ResultSet rs = statement.executeQuery("SELECT geometry FROM states where name='Florida'");
STRUCT st = (oracle.sql.STRUCT) rs.getObject(1);
//convert STRUCT into geometry
JGeometry j_geom = JGeometry.load(st);


My first question: Has anyone implemented a UserType for this spatial scenario before I try? - If yes, I would appreciate some sample code for the UserType.

I see no point in reinventing the wheel and unfortunately I'm not sure if the Hibernate examples for Oracle Blobs work similar or same Oracle STRUCT.
My second one: Does it make more sense to map to STRUCT or implicitely do the JGeometry conversion?

Thanks a lot!

Cheers,
Michael


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

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.