-->
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.  [ 6 posts ] 
Author Message
 Post subject: [XDoclet] how to map properties to a composite-id ?
PostPosted: Wed Nov 10, 2004 12:15 pm 
Newbie

Joined: Wed Sep 15, 2004 9:12 am
Posts: 4
I would like to know what attribute metadata i need to map my properties to a composite-id.

I'll be including more information tomorrow.

[offtopic] i would like to know why my hibernate-properties-className.xml files from the mergeDir aren't merged... [/offtopic]


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 10, 2004 7:26 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
You place the property markup with each key field on the key's java file. There is no XDoclet support for integrated composite keys.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 11, 2004 5:30 am 
Newbie

Joined: Wed Sep 15, 2004 9:12 am
Posts: 4
As a result of not being able to map a composite-id with XDoclet, i would like to include the mapping from the mergeDir.

I got this idea from the following lines form the generated .hbm.xml file;
Quote:
To add non XDoclet property mappings, create a file named
hibernate-properties-ClassName.xml
containing the additional properties and place it in your merge dir.


I excluded any @hibernate tags dealing with id's so i got no id in the generated .hbm.xml file. I put the following xml in my hibernate-properties-ClassName.xml (it's in the /etc dir):

Code:
<composite-id>
   <key-many-to-one class="ClassA" name="a" column="a"/>
   <key-many-to-one class="ClassB" name="b" column="b"/>
</composite-id>


The following lines are from my build.xml:
Code:
<hibernatedoclet
   destdir="${classes}"
   excludedtags="@version,@author,@todo,@since"
   force="false"
   mergedir="${basedir}/etc"
   verbose="true">
   <fileset dir="${src}">
      <include name="**/*Impl.java"/>
   </fileset>
   <hibernate version="2.0"/>
</hibernatedoclet>


i can't seem to get it included. :/
Pls tell me your thoughts on this mather...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 11, 2004 6:09 am 
Newbie

Joined: Wed Sep 15, 2004 9:12 am
Posts: 4
... i forgot to include the right package dirs :/ stupid me...

now i do have a real problem,

XDoclet complains about not having an hibernate.id set, while that was my hole intention...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 11, 2004 6:07 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Is there are reason you have chosen to use integrated composite keys?
It is not the recommended approach (see HIA for an explanation).


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 12, 2004 5:28 am 
Senior
Senior

Joined: Wed Aug 27, 2003 4:08 am
Posts: 178
Location: Wiesbaden, Germany
Daniel Rijkhof wrote:
... i forgot to include the right package dirs :/ stupid me...

now i do have a real problem,

XDoclet complains about not having an hibernate.id set, while that was my hole intention...


However, if you like to have integrate composite keys ( although highly unrecommendet ) pos support issue for xdoclet-2 plugin
( see signature )

and I will implement it to you.

regards,

_________________
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.  [ 6 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.