hi friends.
I have a problem in hibernate mapping between two tables.
the below is the mapping file:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="Group" table="group_category">
<id name="categoryID" column="group_category_id" type="java.lang.Long">
<generator class="assigned"/>
</id>
<property name="shortDescription" column="group_category_short_description"/>
<property name="longDescription" column="group_category_long_description"/>
<list name="groupPermission" table="group_permission" cascade="all">
<key column="group_category_id" update="true"/>
<index column="item_code"/>
<one-to-many class="GroupPermission"/>
</list>
</class>
<class name="GroupPermission" table="group_permission">
<composite-id>
<key-property name="categoryID" column="group_category_id" type="java.lang.Long"/>
<key-property name="itemcode" column="item_code" type="java.lang.String"/>
</composite-id>
<property name="shortDescription" column="group_permission_short_description"/>
</class>
</hibernate-mapping>
i have two tables. 1) Group
2) GroupPermission
GroupPermission table has a composite key which consists of:
1)Group id that is generated from the 1st table.
2)itemcode which is a
string.
as you see in the mapping file i mentioned itemcode as the index column.
i think the index column should be integer or some numeric value.
so what should i do to solve this problem.
please help me in solving this problem. Thank you all