-->
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.  [ 3 posts ] 
Author Message
 Post subject: composite-id and many-to-one
PostPosted: Fri Mar 12, 2004 11:32 am 
Newbie

Joined: Fri Mar 12, 2004 11:04 am
Posts: 10
Hi all,

I have three tables:
Table ACCOUNT, pk = acco_id
Table SUBSCRIBER, pk = subb_id

and

Table ACCO_SUBCRI, pk = component id (acco_id, subb_id)
This table contains not only the relationship, but also other fields like
e.g. actif, date activation,


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 12, 2004 12:02 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
show generated sql


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 12, 2004 12:09 pm 
Newbie

Joined: Fri Mar 12, 2004 11:04 am
Posts: 10
Ok sorry, I found this one work's :

<hibernate-mapping>
<class name="com.my.AccoSubbBEAN" table="ACCO_SUBCRI">

<composite-id>
<key-property name="acco_id" column="acco_id" type="integer"/>
<key-property name="subb_id" column="subb_id" type="integer"/>
</composite-id>


<property name="accsubb_actif" column="accsubb_actif"/>

<many-to-one name="account" class="com.my.AccountBEAN" column="acco_id" insert="false" update="false" />
<many-to-one name="subscriber" class="com.my.SubscriberBEAN" column="subb_id" insert="false" update="false" />


</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.  [ 3 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.