title: How to use List in Hibernate XML mapping?
body: <p>I have Department and Employee entities, I want to map them as one to many.
  How can I use List in XML mapping instead of Set? I found this code from Internet, but when execute <code>"from Department"</code>, the error is <code>"Repeat property department_id in Employee.department"</code>, but if I remove the <code>&lt;index&gt;</code> in department, it's will
  be <code>"Unable to read XML"</code>.
  Department.hbm.xml</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"&gt;
  &lt;!-- Generated Aug 2, 2015 7:14:52 AM by Hibernate Tools 4.3.1 --&gt;
  &lt;hibernate-mapping&gt;
      &lt;class name="emp.entity.Department" table="department" schema="dbo" catalog="Emp" optimistic-lock="version"&gt;
          &lt;id name="departmentId" type="long"&gt;
              &lt;column name="department_id" /&gt;
              &lt;generator class="assigned" /&gt;
          &lt;/id&gt;
          &lt;property name="deptName" type="string"&gt;
              &lt;column name="dept_name" length="50" not-null="true" /&gt;
          &lt;/property&gt;
          &lt;list name="employees" table="Employee" inverse="true" cascade="all" &gt;
              &lt;key&gt;
                  &lt;column name="department_id" /&gt;
              &lt;/key&gt;
              &lt;index column="department_id"&gt;&lt;/index&gt;
              &lt;one-to-many class="emp.entity.Employee" /&gt;
          &lt;/list&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>Employee.hbm.xml</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"&gt;
  &lt;!-- Generated Aug 2, 2015 7:14:52 AM by Hibernate Tools 4.3.1 --&gt;
  &lt;hibernate-mapping&gt;
      &lt;class name="emp.entity.Employee" table="Employee" schema="dbo" catalog="Emp" optimistic-lock="version"&gt;
          &lt;id name="employeeId" type="int"&gt;
              &lt;column name="employee_id" /&gt;
              &lt;generator class="assigned" /&gt;
          &lt;/id&gt;
          &lt;many-to-one name="department"  class="emp.entity.Department" fetch="select"&gt;
              &lt;column name="department_id" /&gt;
          &lt;/many-to-one&gt;
          &lt;property name="firstname" type="serializable"&gt;
              &lt;column name="firstname" /&gt;
          &lt;/property&gt;
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>