-->
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: using xdoclet to map cpomposite elements
PostPosted: Sun Apr 16, 2006 8:08 am 
Newbie

Joined: Wed Mar 08, 2006 8:11 am
Posts: 17
Location: Israel
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0.5

I am trying to generate my mapping xml files using xdoclet tags. I have the "target" xml ready, and I am trying to get the generated ones to be identical to it, so that future code modifications will be easier.
I have a class with a Map collection of another class, which is a value type (as defined in "Hibernate in Action"). The current (working) xml snippet is:

Code:
<map name="myMap" lazy="true"
   table="VALUE_TYPES" >
   <key column="ID" />
   <map-key column="CODE" type="integer" length="6" />
   <composite-element class="values">
      <property name="name" column="NAME"
         type="java.lang.String" length="10" />
      <property name="note" column="NOYE"
         type="java.lang.String" length="20" />
   </composite-element>
</map>


and the tags I currently have in my java file are:

Code:
/**
* @hibernate.map lazy="true" inverse="true" cascade="none" table="VALUE_TYPES"
* @hibernate.collection-key column="ID"
* @hibernate.collection-map-key name="CODE" <-- NOT WORKING
* @hibernate.collection-composite-element class="Values"
*/
public Map getMyMap() {
   return myMap;
}


the 3rd tag is ignored, probably because the name isn't being recognized by xdoclet at all. What tag can I use, and where should I put it? maybe I should somehow add this tag to the Values class? if so - what should I add there?

Thank you for your help


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 16, 2006 9:15 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Here is your reference for the approrpiate tags
http://xdoclet.net/xdoclet/tags/hibernate-tags.html
Note: The CVS version has many additional tags.

You are using an invalid tag so its being ignored.
use the @collection-index tag


Top
 Profile  
 
 Post subject: Thanks for the link
PostPosted: Tue Apr 18, 2006 1:13 am 
Newbie

Joined: Wed Mar 08, 2006 8:11 am
Posts: 17
Location: Israel
I've been using the collection-index yesterday, but it generates an "index" element under the "map" in the xml, and not a "map-key"
are these two tags the same in this context?
What is the CVS version? is this some xDoclet beta? And where can I see it's (hibernate) tag list?
I bumped into an xDoclet 2 tag list page, but I thought it is only a beta, and I couldn't find any download link. Anyway - I won't be able to use this beta version, I believe..

Thanks for the reference, though.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 18, 2006 7:49 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
XDoclet 1.2.3 has a few issues when using Version="3.0" for hibernate xml generation. The CVS version (to XDoclet 1.3.x) has many fixes and ehancements that I would suggest you download and build it. Alternatively, XDoclet 2 could be a decent candidate as well. It uses different Tags and I understand is quite stable.


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.