-->
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.  [ 5 posts ] 
Author Message
 Post subject: composite-id & annotations?
PostPosted: Wed Aug 16, 2006 9:16 am 
Regular
Regular

Joined: Mon Mar 06, 2006 6:18 am
Posts: 95
Location: Bern, Switzerland
Hello

i'm new to the hibernate annotations. I try to define the following composite id with annotations. is it possible?

Code:
<hibernate-mapping>
    <class name="najsre7.model.TransaktionAktionMapping" table="TTRANSAKTION_AKTION" >
        <composite-id>
            <meta attribute="use-in-tostring">true</meta>
            <meta attribute="use-in-equals">true</meta>
         <key-many-to-one name="transaktion" class="najsre7.model.Transaktion" column="FK_TTRANSAKTION_ILAUFNR" />
         <key-many-to-one name="aktion" class="najsre7.model.Aktion" column="FK_TAKTION_ILAUFNR" />       
        </composite-id>
        <timestamp name="mutDatum" column="DMUTDAT" />
        <property name="mutUser" type="java.lang.String">
            <meta attribute="use-in-tostring">true</meta>
            <meta attribute="use-in-equals">true</meta>
            <column name="SMUTUSER" length="10" not-null="true" />
        </property>
        <property name="stvUser" type="java.lang.String">
            <meta attribute="use-in-tostring">true</meta>
            <meta attribute="use-in-equals">true</meta>
            <column name="SSTVUSER" length="10" />
        </property>
       <many-to-one name="transaktion" class="najsre7.model.Transaktion" column="FK_TTRANSAKTION_ILAUFNR" lazy="false" fetch="join" insert="false" update="false"/>
       <many-to-one name="aktion" class="najsre7.model.Aktion" column="FK_TAKTION_ILAUFNR" lazy="false" fetch="join" insert="false" update="false"/>
    </class>
</hibernate-mapping>


regards
angela


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 17, 2006 3:36 am 
Regular
Regular

Joined: Mon Mar 06, 2006 6:18 am
Posts: 95
Location: Bern, Switzerland
any ideas how to map this composite primary key?

btw: I don't want to create a separate class for the composite id.

Angela


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 18, 2006 6:05 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This is not possible if you don't create a separate class.
I don't have time to work on that but a patch would be welcome

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 20, 2006 1:32 am 
Regular
Regular

Joined: Mon Mar 06, 2006 6:18 am
Posts: 95
Location: Bern, Switzerland
is this possible in the final release 3.2 of hibernate annotations??

regards angela


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 25, 2006 11:33 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
no

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.