-->
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.  [ 2 posts ] 
Author Message
 Post subject: Support for class hierarchy as components?
PostPosted: Wed Nov 26, 2003 7:58 am 
Newbie

Joined: Wed Nov 26, 2003 7:37 am
Posts: 1
Hello all,


Hibernate is really cool, simple and elegant.


I studied Chapter 6: Components (v2.0.2) and would like to know if subcomponents (similarly to class/subclass concept for mapping a class hierarchy) could be somehow supported?

I have checked the Hibernate 2.0 DTD and it does not seem to support it. Am I right?

The example from the Hibernate reference document shows a class "eg.Name" being a component of class "eg.Person":

Code:
<class name="eg.Person" table="person">
      <id name="id" column="id" type="int">
         <generator class="sequence"/>
      </id>
      <property name="birthday" type="date"/>
      <component name="name" class="eg.Name">
         <parent name="namedPerson"/> <!-- reference back to the Person -->
         <property name="initial" type="char"/>
         <property name="first" type="string"/>
         <property name="last" type="string"/>
      </component>
</class>


What could I do with subclasses of class "eg.Name", for example "eg.ChineseName" and "eg.OtherFancyName"? Can I use them as components of class "eg.Person"? If yes, how?

Any help is appreciated. Thanks,
Peter


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 26, 2003 8:57 am 
Beginner
Beginner

Joined: Tue Nov 25, 2003 3:33 pm
Posts: 35
why don't you just try to change
<component name="name" class="eg.Name">

to
<component name="name" class="eg.YouWhateverFancyName">

Alex.


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