title: Generate Unique Long ID for a view in MySql
body: <p>I have a view over three tables. It has 6 columns as follows:</p>
  
  <pre><code>ID | NAME | PRINCIPAL_ID | DESCRIPTION | GROUP_ID | TYPE
  </code></pre>
  
  <p>As I'm using <code>hibernate</code> to retrieve data from database, I had to put the <code>ID</code> column in this view. The problem is, I cannot generate a unique <code>ID</code> which seems to be necessary for <code>hibernate</code> to correctly load the data.</p>
  
  <p>How can I have a unique ID for every row in this view?</p>
  
  <p><em>Maybe this can help, I'm not sure</em>: The combination of <code>PRINCIPAL_ID</code> and <code>GROUP_ID</code> can make a unique ID. All these three are <code>Long</code>.</p>