-->
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 inheritance while tables joint per ids
PostPosted: Thu Sep 22, 2005 5:32 pm 
Newbie

Joined: Thu Sep 22, 2005 5:17 pm
Posts: 11
hello all,
i have two classes,


public class Keystone {
private Integer id = null;
private String name = null;
// here are get/set methods
}

public class Login extends Keystone {
private String username = null;
private String pass = null;
// get/set methods
}


each class has its own table

table TKeystone (
id integer - primary key,
name nvarchar
)

table TLogin (
id integer - primary key, foreign key
pass nvarchar,
username nvarchar
)


column id in TLogin is primary key and also foreign key that references id column in TKeystone

i don't know how to write mapping files for these classes, i've read docs on hiberante.org, searched in this forum, searched by google but nothing found

can someone help me, please write here the whole configuration files

_________________
thanks
blaf


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 5:58 pm 
Beginner
Beginner

Joined: Tue Apr 05, 2005 4:27 pm
Posts: 40
Location: canada
you need to use a joined-subclass mapping. you can copy the example from the docs...

http://www.hibernate.org/hib_docs/v3/reference/en/html/inheritance.html#inheritance-tablepersubclass


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 6:19 pm 
Newbie

Joined: Thu Sep 22, 2005 5:17 pm
Posts: 11
and isn't here any other possibility? i'd like to have one config file for each class, or it's necessary to have mapping for all subclasses in the config file for superclass?

where will i have mapping for Login subclass???? in xml file file keystone or login????

thanks

_________________
thanks
blaf


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 9:54 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
<joined-subclass extends="...">


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 23, 2005 3:04 am 
Newbie

Joined: Thu Sep 22, 2005 5:17 pm
Posts: 11
i don't know where is error but it doesn't work, could you write here the mapping files for my simple classes i wrote upper???
two files please
Keystone.hbm.xml and Login.hbm.xml

thanks a lot

_________________
thanks
blaf


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.