-->
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: XML design trouble...
PostPosted: Fri Mar 17, 2006 6:49 am 
Newbie

Joined: Tue Mar 07, 2006 4:56 am
Posts: 17
Hello together,

after my initial Post about a problem, which got solved, I was quite a happy camper. But as it always is with life, the next problem just lurks around the corner. So here I go...

First off, I'm dealing with a legacy database, so I can't change the tables.

I got an object, called an "Outlet", which is saved to the "Outlet" table, however, some additional data is stored in a second table, called "OutletExt". The two tables essentialy describe my Outlet object (one-to-one relation).

My Problem again is, how do I define the XML, and how would my class look like? Do I have to create two classes and then do a "subclass" or a "joined-subclass"? Or do I create simply one class and define the table-split in the xml?

I hope someone can shed some light on this for me.

Kind regards, Marco...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 21, 2006 1:50 pm 
Expert
Expert

Joined: Fri May 13, 2005 11:13 am
Posts: 292
Location: Rochester, NY
My understanding is that you have to use <joined-subclass> to accomplish what you want. The good news is that you don't have to create two classes; you could map to an interface and a class:

Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" >
   <class name="IObject" table="Object" >
      ...
      
      <joined-subclass name="Object" table="ObjectExt" >
         ...
      </joined-subclass>
   </class>
</hibernate-mapping>


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.