title: Can I use 2 primary key id in the hibernate mapping file?
body: <p>`</p>
  
  <p></p>
  
  <pre><code>&lt;hibernate-mapping&gt;
  
  &lt;class name="beans.EmployeeBean" table="employeedetails" schema="Employee"&gt;
  &lt;id name="empId" column="empid"/&gt;
  &lt;id name="employeeusername" column="username"/&gt;
  &lt;property name="firstname" column="firstname"/&gt;
  &lt;property name="designation" column="designation"/&gt;
  &lt;property name="email" column="email"/&gt;
  &lt;property name="role" column="role"/&gt;
  &lt;/class&gt;
  
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>In this code when i am putting the second id username i am getting error and in my database also in 1 table i put 2 columns as primary key.</p>