-->
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.  [ 4 posts ] 
Author Message
 Post subject: Very simple XDoclet key question !
PostPosted: Wed Nov 17, 2004 12:47 pm 
Newbie

Joined: Fri Nov 05, 2004 1:06 pm
Posts: 9
Hi,
Is it possible to generate the following syntax from Xdoclet (hibernate).

<set
name="executions"
lazy="false"
inverse="false"
cascade="all"
sort="unsorted"
>
<key>
<column name="ORDER_NUMBER_C" />
<column name="ORDER_VER_I"/>
<column name="MDATA_SOURCE_I"/>
<column name="MDATA_DOB_D"/>
</key>

<one-to-many
class="com.gs.odin.Execution"
/>

</set>

For the life of me I can't figure out how to get multiple column elements as children of the key element.

Any help would be most appreciated.

Thanks
David


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 8:44 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I try to avoid composite keys when ever I can but
Have you tried multiple @hibernate.column tags?
This is how I would expect it to work.


Top
 Profile  
 
 Post subject: XDoclet - mutliple key columns in a one-to-many collection
PostPosted: Thu Nov 18, 2004 5:32 am 
Newbie

Joined: Fri Nov 05, 2004 1:06 pm
Posts: 9
David,
Yes, I have tried @hibernate.column as well as @hibernate.collection-key-column in fact using these tags doesn't yield me anything, i.e. no key elements !

If, however I use @hibernate.collection-key column I only get one of the columns showing up in my key element, it seems to ignore the rest.

code :

/**
* @hibernate.set role="executions" cascade="all" readonly="true"
* @hibernate.collection-key column="ORDER_NUMBER_C"
* @hibernate.collection-key column="ORDER_VER_I"
* @hibernate.collection-key column="MDATA_SOURCE_I"
* @hibernate.collection-key column="MDATA_DOB_D"
* @hibernate.collection-one-to-many class="com.gs.odin.Execution"
*/
public Set getExecutions(){
return mExecutions;
}

generates :

<set
name="executions"
lazy="false"
inverse="false"
cascade="all"
sort="unsorted"
>

<key
column="ORDER_NUMBER_C"
>
</key>

<one-to-many
class="com.gs.odin.Execution"
/>

</set>

After spending a reasonable amount of time trying to figure out hibernate's xdoclet tags, I really don't want to go back to hand editing xml files .. it's very fustrating.

Any ideas, anyone ?

Cheers
David


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 18, 2004 2:17 pm 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
Well, you may try hibernate plugin for xdoclet-2. Multiple colelction key columns are supported
there.
( If it does not work for you, file jira issue... I'll take care of it )

http://docs.codehaus.org/display/XDOCLE ... key-column

And documentation for hibernate plugin is under:

http://docs.codehaus.org/pages/viewpage ... ageId=2215

_________________
Got new hibernate xdoclet plugin? http://www.sourceforge.net/projects/xdoclet-plugins/
... Momentan auf der Suche nach neuen Projekt ode Festanstellung....


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