title: How to return Map<Key, Value> with Hibernate\HQL
body: <p>I have an entry as follow:</p>
  
  <pre><code>@Entity
  @Table(name="rank")
  class Rank implements Serializable {
   private int id;
   private int rank_id;
   private date creationDate;
   ...
   // getters\setters...
  }
  </code></pre>
  
  <p>I would like to query this table and put the results into a HashMap!
  as follow:</p>
  
  <pre><code>Map&lt;Integer, Rank&gt; = session.createSQL("select new map...").list();
  </code></pre>
  
  <p>Is this possible to put the entity as the value of the map?</p>
  
  <p>Can I get a code example?</p>