-->
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: GAVIN HELP!!! Composite Id needs generator
PostPosted: Tue Jun 19, 2007 12:36 am 
Beginner
Beginner

Joined: Mon Apr 23, 2007 8:30 am
Posts: 27
Location: India
Hello,

I have a mapping that contains a composite id with two keys. I require something like different genertors for the two keys; foreign for first key and assigned for the second key. The relevant section from the mapping file is as follows:-

Code:
<hibernate-mapping auto-import="false">
    <class name="abc.UserContactInfo" table="USER_CONTACT_INFO">
        <composite-id name="id" class="abc.UserContactInfoId">
            <!-- Foreign generator with property as  userPersonalInfo -->
            <key-property name="userId" type="string">
                <column name="USER_ID" length="40" />
            </key-property>
           
            <!-- assigned generator, set on the object -->
            <key-property name="type" type="string">
                <column name="TYPE" length="10" />
            </key-property>
        </composite-id>
        <many-to-one name="userPersonalInfo" class="abc.UserPersonalInfo" update="false" insert="false" fetch="select">
            <column name="USER_ID" length="40" not-null="true" />
        </many-to-one>


How can I get my composite id generation to be a mix of foreign and assigned i.e foreign for the first key and assigned for the second key.

Thanks,
Nikhil


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.