-->
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.  [ 1 post ] 
Author Message
 Post subject: Mapping other tables' fields
PostPosted: Wed Mar 15, 2006 9:51 am 
Newbie

Joined: Fri Mar 03, 2006 1:28 pm
Posts: 9
Ok. I've been around this so many time and, as much as I believe this might be easier than I think, I just can't get to a solution.

My problem is this: I have a database with tables I'm not allowed to alter. I also have a class diagram with extensive use of inheritance that I dind't want to alter much. I'm mapping using a table-per-class hierarchy approach, using subclass tags.

Let's just say I have this class CLASS with attributes A B and C. A and B map to fields X and Y in table TABLE1, but C maps to field Z in table TABLE2.

I was mapping something like this:

Code:
<class>
    name="CLASS"
    table="TABLE1"
    discriminator-value="...">

      (...)

    <property
        name="A"
        column="X"
        type="..."/>


    <property
        name="B"
        column="Y"
        type="..."/>

      (...)

</class>


Now what I don't know is how to add something like a property tag but referencing a single field Z in TABLE2. I understand it has something to do with one-to-one assotiations, but I still don't know how is this to be done.

Thanks in advance for your replies.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.