Hi all
I am very new to the hibernate
Can any one of u help me solving the following issue.
i have a user and a tmeplate as entities
The relation between them is a User can have only one template and template
can have any number of users.
Can anyone of u help me in writing  the mapping files.

I included the following lines in template.hbm.xml file
<list name="users" table="USER_TEMPLATE">
                <key column="USER_ID"/>
                <index column="TEMPLATE_ID" />
                <composite-element 
class="com.ascendum.test.entities.UserTemplate">
                        <many-to-one name="user" 
class="com.ascendum.test.entities.User">
                        <meta attribute="use-in-string">true</meta>
                                <column name="USER_ID"/>
                        </many-to-one>
        <!--    <property name="TemplateId" type="int" not-null="true"
column="TEMPLATE_ID" index="class.ascendum.test.entities.Template"/-->
                </composite-element>
        </list>
This is not taking the foreign keys as i want
i want the USER_TEMPLATE to have the PK as USER_ID (references USER) and
TEMPLATE_ID shud refere TEMPLATE

Can any one of u help me with this
Thanks in advance

Madhuri



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
xdoclet-devel mailing list
xdoclet-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to