i have 2 tables .table1 column id which is foreign key to table2 which has column parent_id to
hold table1 id value ,column idx to hold index value.My mapping file looks like this
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping
PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
"hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="List_1"
table="List_1">
<id name="id" unsaved-value="0">
<generator class="increment"/>
</id>
<list name="stories" cascade="all">
<key column="parent_id"/>
<index column="idx"/>
<one-to-many class="List_2"/>
</list>
<property name="name" type="java.lang.String" column="description"/>
</class>
<class name="List_2"
table="List_2">
<id name="id" unsaved-value="0">
<generator class="increment"/>
</id>
<property name="info" column="track"/>
</class>
</hibernate-mapping>
I don’t know how to generate one mapping file for 2 tables which are connected.
Thanks