-->
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: can hibernate map from ORDBMS object?
PostPosted: Sun Jan 04, 2004 8:10 am 
Newbie

Joined: Sat Jan 03, 2004 5:13 am
Posts: 4
for exampe: oracle DBMS can create object type like this
create type Student as Object
( varchar2(6) idStudent,
varchar2(10 name,
char(1) sex
)
then oracle can create a table like this:
create table stu of Student
( Student s)

can hibernate map this table to Java class StudentCls?
class StudentCls
{
string id;
string name;
char sex;
.......
}


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 1:42 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
What does the SQL to INSERT / UPDATE / SELECT from stu look like?

If it looks sufficiently similar to a "normal" table, it should work fine.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 4:19 am 
Newbie

Joined: Sat Jan 03, 2004 5:13 am
Posts: 4
there has some difference, for example, when INSERT, SQL statement should like this:
insert into stu values
( Student('123456', 'woo', 'm'));

it need a constructor(like Student(...)) to construct the object when insert a new row

gavin wrote:
What does the SQL to INSERT / UPDATE / SELECT from stu look like?

If it looks sufficiently similar to a "normal" table, it should work fine.


Top
 Profile  
 
 Post subject: Re: can hibernate map TABLE from Object-RDBMS class?
PostPosted: Mon Jan 05, 2004 4:38 am 
Newbie

Joined: Sat Jan 03, 2004 5:13 am
Posts: 4
but i can create tables like normal, for example:

create table stu
(
address VARCHAR2(20),
s Student
)

Student is the object type created for Object-Relation DBMS

when i select like this:
select * from stu;
it show:
ADDRESS S(ID, NAME, SEX)
----------------------------------------------------------------
tokyo STUDENT('001', 'woo', 'm')
yakada STUDENT('002', 'ray', 'm')


so can i hibernate map this table to Java class StudentCls?
[color=brown]class [/color]StudentCls
{
String id;
String name;
char sex;
String address;
.......
}


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 05, 2004 1:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You could try writing a custom ClassPersister.


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.