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