-->
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: need help in xdoclet tag
PostPosted: Mon Feb 25, 2008 9:52 am 
Newbie

Joined: Wed Dec 12, 2007 4:48 am
Posts: 6
how to write xdoclet tags for using set relationship with composit primary key?

/**
*
* @hibernate.set role="orgABc"
*
* @hibernate.collection-key column="a" column="b"
*
* @hibernate.collection-one-to-many class="com.sp.Rating"
*/


when i write the following in java file ,the corresponding hbm file is not generating properly.

please help me ..................


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 25, 2008 11:31 am 
Senior
Senior

Joined: Fri Jun 01, 2007 12:41 pm
Posts: 121
I have faced this problem. XDoclet has problem generating composite primary key. You have to edit the hbm.xml file manually to add the composit primary key after generating it from XDoclet.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 10, 2008 1:42 am 
Newbie

Joined: Wed Dec 12, 2007 4:48 am
Posts: 6
I resolved the prob using the below xdoclet tag


/**
*
* @hibernate.set role="orgABc"
*
* @hibernate.collection-key
*
*@hibernate.collection-key-column name="a"
*
*@hibernate.collection-key-column name="b"
*
*
* @hibernate.collection-one-to-many class="com.sp.Rating"
*/


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 10, 2008 12:26 pm 
Senior
Senior

Joined: Fri Jun 01, 2007 12:41 pm
Posts: 121
I have used the same in my XDoclet attributes in my POJO. But the generated hbm.xml file has <properties> that includes all properties of my bean.

So I have to manually write some thing like this:

Code:
<properties name="a_b_unique" unique="true">
        <many-to-one
            name="a"
                not-null="true"
                cascade="save-update"
                lazy="false"
                fetch="join"
        >
        </many-to-one>

        <many-to-one
            name="b"
                not-null="true"
        >
        </many-to-one>
   </properties>

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 12, 2008 10:24 am 
Newbie

Joined: Wed Dec 12, 2007 4:48 am
Posts: 6
Can u post ur total java file which contains xdoclet tags?


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.