title: How to create liferay Service xml for multiple foreign key of same primary key?
body: <p><img src="https://i.stack.imgur.com/DatIa.png" alt="enter image description here"></p>
  
  <p>I know the question might be confusing,any ways I will explain it.</p>
  
  <p>Basically I have two tables. Student and Course where studentid and courseid are their corresponding primary keys.</p>
  
  <p>In the Student table I have two attributes  courseid and courseidbackup both are key(FK) to the course table.
  This is the service xml I am using, but it shows build unsuccessful. </p>
  
  <p>What am I missing here? How to create service xml to achieve this ? </p>
  
  <pre><code> &lt;service-builder package-path="com.students.db"&gt;
  &lt;author&gt;bugs&lt;/author&gt;
  &lt;namespace&gt;students&lt;/namespace&gt;
  &lt;entity name="Student" local-service="true" remote-service="true" cache-enabled="false"&gt;
  &lt;column name="studentId" type="long" primary="true" /&gt;
  &lt;column name="studentName" type="String" /&gt;
  
  &lt;column name="coursesid" type="Collection" entity="Course" mapping-table="Students_Courses"/&gt;
  &lt;column name="coursesidbackup" type="Collection" entity="Course" mapping-table="Students_Courses"/&gt;
  &lt;/entity&gt;
  &lt;entity name="Course" local-service="true" remote-service="true" cache-enabled="false"&gt;
  &lt;column name="courseId" type="long" primary="true" /&gt;
  &lt;column name="courseName" type="String" /&gt;
  &lt;column name="courseDetails" type="String" /&gt;
  &lt;column name="students" type="Collection" entity="Student" mapping-table="Students_Courses" /&gt;
  &lt;/entity&gt;
  &lt;/service-builder&gt;
  </code></pre>