-->
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.  [ 5 posts ] 
Author Message
 Post subject: Mapping Oracle Structs
PostPosted: Tue Sep 14, 2004 9:33 pm 
Regular
Regular

Joined: Fri Sep 03, 2004 2:01 pm
Posts: 51
Hibernate version: 2.1.6

Name and version of the database you are using:
Oracle 8 and 9

We have some legacy data (that has a snow balls chance in hell of being altered) that is stored in tables that use Oracle PL/SQL structs/objects.

Would Hibernate support these custom data types if I were to extend UserType, and somehow manage to insert the required PL/SQL method calls to get/set the underlying struct?

If so, any pointers?


Top
 Profile  
 
 Post subject: Same Issue - any help?
PostPosted: Tue Jan 04, 2005 2:10 pm 
Newbie

Joined: Tue Sep 23, 2003 12:03 pm
Posts: 7
Location: Wisconsin
Hi-

I am also wondering about the use of Oracle's STRUCT type with Hibernate - what is the appropriate mapping type?


My goal (not related to the question) is to store spatial data in an Oracle 10G database. The data is stored as a STRUCT, which Oracle can convert to a JGeometry object.

Any help on how to map an Oracle STRUCT type?

Thanks,
Eric Everman

_________________
the man comes around


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 04, 2005 2:18 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You could use a custom UserType most likely, if you know how to retrieve that stuff from a ResultSet.


Top
 Profile  
 
 Post subject: Rephrasing the question
PostPosted: Tue Jan 04, 2005 3:11 pm 
Newbie

Joined: Tue Sep 23, 2003 12:03 pm
Posts: 7
Location: Wisconsin
Hi-

Thanks for the response, but I was way to vague in my question. I'm planning on using a custom UserType, but I'm am unsure of what to return from the sqlTypes() method.

Since there is no Hibernate.Struct type, do I return Hibernate.Binary?


====== The UserType method in question =========
public class MyCustomType implements UserType {

public MyCustomType() {}

public int[] sqlTypes() {
return new int[] { ???? what to return? ???? };
}
...
}
======================================

Thanks again,
Eric Everman

_________________
the man comes around


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 04, 2005 10:39 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Well usually some constant from java.sql.Types - best is to have a look at the source on how it is used, figure out what works that way ...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.