title: To map a database view with no primary key, in hibernate xml mapping
body: <blockquote>
    <p><strong>I have created a view which will be used for fetching the data only(readonly)</strong></p>
  </blockquote>
  
  <p>View : Grid_View</p>
  
  <p><strong>> My Hibernate hbm file</strong></p>
  
  <pre><code>&lt;hibernate-mapping&gt;   
       &lt;class name="hibernate.domain.View" table="Grid_View" mutable="false"&gt;
           &lt;property name="ACCT_BR_CD" type="string"&gt;
              &lt;column name="ACCT_BR_CD"/&gt;
          &lt;/property&gt;
          &lt;property name="ACCT_NO" type="string"&gt;
              &lt;column name="ACCT_NO"/&gt;
          &lt;/property&gt;
          &lt;property name="LGL_ENTY_NM" type="string"&gt;
              &lt;column name="LGL_ENTY_NM"/&gt;
          &lt;/property&gt;
          &lt;property name="CUST_CTRY_CD" type="string"&gt;
              &lt;column name="CUST_CTRY_CD"/&gt;
          &lt;/property&gt;
          &lt;property name="ACCT_SRC_SYS_CD" type="string"&gt;
              &lt;column name="ACCT_SRC_SYS_CD"/&gt;
          &lt;/property&gt;    
      &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p><strong>> As their is no primary key in my view,Ihave not mentioned id field in my mapping.</strong>
        But in hibernate id is required.</p>
  
  <p><strong>> My Question</strong></p>
  
  <p>How to proceed with the mapping without id in the hibernate mapping file.
  And their are no columns with unique values so thier is no any chance of making them the key. Please help me resolve this issue</p>