title: Why does hibernate create different column aliases for same query in different JVM instances?
body: <p>When I monitor SQL queries generated by hibernate in my Java app, there are column aliases for each column used in the query. But the column aliases are suffixed with different numbers for different JVM instances.</p>
  
  <p>For example:</p>
  
  <pre><code>select user0.ID as ID1_276_,
  user0.DESCRIPTOR_ID as DESCRIPTOR10_276_,
  user0.USER_ID as USER11_276_ 
  from CI_USER user0
  where ...
  </code></pre>
  
  <p>But the suffixes in the column aliases keep changing when the app is restarted. I am not sure exactly what the logic or formula to these suffixes is, i.e. <code>_276_</code>. Sometimes, the same query shows something like the following:</p>
  
  <pre><code>select user0.ID as ID1_144_,
  user0.DESCRIPTOR_ID as DESCRIPTOR10_144_,
  user0.USER_ID as USER11_144_ 
  from CI_USER user0
  where ...
  </code></pre>
  
  <p>Only the column aliases keep changing. The table aliases stay same. Could someone help in pointing how hibernate comes up with these numbers in suffixes? Also, can I stop these suffixes altogether? I want queries without column aliases or with same column aliases.</p>
  
  <p>One of the side-effects caused by different column aliases in Oracle is that the same SQL explain plan can't be used, since it is locked to a specific query.</p>