title: setting the hql or criteria for the below sql with decode condition in sql
body: <p>I have the below following pojo and I have to generate the hql or criteria  for the following sql..</p>
  
  <pre><code>class took
  {
   private String aaa;
   private String bbb = "";
   private String ccc;
  
  
  public took(String aaa, String bbb ,String ccc)
      {
      this.aaa = aaa;
      this.bbb = bbb;
      this.ccc = ccc;     
      }
  }
  
  SELECT aaa,DECODE(bbb_b,'Y','Act','Rev') as perm,ccc_c FROM took
  </code></pre>
  
  <p>I have also generated the HQL for this as shown below , but the issue with this query is that as shown in the above sql query that I am using DECODE on column bbb_b and setting it value plus this column perm is created dynamically in this query itself so how would I adjust this in hql itself
  please advise.</p>
  
  <pre><code>List&lt;took&gt; b1 = session.createQuery("select new com.abc.def.took(aaa, bbb,ccc) from took").list();
  </code></pre>
  
  <p>please advise for crtiteria equivalent for this</p>