-->
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: Beginner need help: many-to-one or one-to-one mapping SOLVED
PostPosted: Thu Jul 27, 2006 11:16 am 
Newbie

Joined: Thu Jul 27, 2006 11:10 am
Posts: 2
Hi,

I have a problem I can't figure out to solve, I'm sure I'm just stupied and it's easy to solve but I can't figure out how.

I have two tables:

TT_FEATURE and TT_FEATUREINFORMATION

In the Feature class i have a property called FeatureInformation.

So how do I do this mapping, i tried something like this, but of course it didn't work.

<joined-subclass name="Feature" table="TT_FEATURE" lazy="true">
<many-to-one name="featureInformation" column="FEATURE_ID" class="FeatureInformation" unique="true" />
</joined-subclass>

The problem is the reference between the two tables is given in the TT_FEATUREINFORMATION table, and not in the TT_FEATURE (if it was the opposite, the above would work).

Cheers,

Per


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 27, 2006 11:43 am 
Newbie

Joined: Thu Jul 27, 2006 11:10 am
Posts: 2
Solved it, post my result here so other stupid people like me can find the solution.

<one-to-one name="featureInformation"
class="FeatureInformation"
foreign-key="FEATURE_ID" />


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.