title: compare key value of map in criteria using hibernate
body: <p>I use <code>docRelatedUseMap</code> map to store document related user in hibernate mapping. I want to fetch particular user documents from it.</p>
  
  <pre><code>&lt;hibernate-mapping &gt;
  &lt;class name="com.v4common.shared.beans.domain.common.transaction.Document" table="document"&gt;
   &lt;id name="id" column="id" type="long"&gt;
   &lt;generator class="native"/&gt;
   &lt;/id&gt;
   &lt;property column="document_name" name="documentName"/&gt;
   &lt;property column="reference_number" name="referenceNumber"/&gt;
   &lt;property column="description" name="shortDescription"/&gt;
   &lt;property column="long_description" name="longDescription"/&gt;
   &lt;property column="status" name="documentStatus"/&gt;
   &lt;property column="open_authority_id" name="openAuthority"/&gt;
   &lt;property column="tender_no" name="tenderNo" type="long"/&gt;
   &lt;property column="offer_no" name="offerNo" type="long"/&gt;
   &lt;map name="docRelatedUserMap" cascade="refresh" table="doc_related_user_map"&gt;
   &lt;key column="document_id"/&gt;
   &lt;map-key  column="user_id" type ="long"/&gt;
   &lt;element column="last_modified_date"  type="timestamp" not-null="true"/&gt;
   &lt;/map&gt;
   &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>In criteria:</p>
  
  <pre><code>Criteria criteria = session.createCriteria(Document.class);
  criteria.setResultTransformer(criteria.DISTINCT_ROOT_ENTITY);
  //need to write line code here
  List&lt;Document&gt; innerDocList=criteria.list();
  </code></pre>
  
  <p>How can I do using criteria in hibernate?</p>