-->
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 with associating class
PostPosted: Tue Oct 06, 2009 2:23 pm 
Newbie

Joined: Tue Jul 21, 2009 2:58 pm
Posts: 6
Hello,

I am attempting to the following


A -----> A_B <------- B


I want to have a 1 - 1 mapping between A and B via the associating class/table A_B

I have been able to cheat and use the following to get many to many but i don't want many to many (at least i don't think so), i want it so that A has a getB() and vis versa.


The following is in the B mapping for example

Code:
  <set name="aSet" inverse="false" table="A_B">
         <cache usage="read-write" region="org.hibernate.cache.StandardQueryCache" />
         <key>
            <column name="B_ID" precision="22" scale="0" not-null="true" />
         </key>
         <many-to-many entity-name="com.test">
            <column name="A_ID" precision="22" scale="0" not-null="true" />
         </many-to-many>
      </set>


This allows the ability to select B and have a in be in a getter but still as a set and NOT as a single one-one.

Any ideas oh how i can remove the hack and have it associated one-one.

Thanks,

Brad


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.