-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to map subclasses in hbm.xml?
PostPosted: Tue Dec 06, 2005 2:09 pm 
Beginner
Beginner

Joined: Wed Apr 27, 2005 8:27 am
Posts: 27
Hi everyone,

I have to map a subclass in my hbm.xml file. There is a father called Person and a child, called User:

public class Person{

}

public class User extends Person{

}

How to map User in Person.hbml.xml?
Should I use <joined-subclass> tag?

<joined-subclass name="User" table="TB_USER" >

<key column="CD_PERSON"/>
<property name="login" column="DS_LOGIN" not-null="true"/>
<property name="password" column="DS_PASSWORD" not-null="true"/>
</joined-subclass>

Can anybody give me a hint?

Thanks a lot!

Guilherme


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 06, 2005 3:25 pm 
Regular
Regular

Joined: Tue Oct 28, 2003 8:25 am
Posts: 72
Location: Belgium
There are many way to map subclasses, have a look there:
http://www.hibernate.org/hib_docs/v3/re ... nheritance

<joined-subclass> allows you to map you subclasses on many tables, one per class. All those tables have to share the same primary key.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 07, 2005 9:01 am 
Beginner
Beginner

Joined: Wed Apr 27, 2005 8:27 am
Posts: 27
Thanks! It solved may problem!


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