title: Exception in java using dao class to get row
body: <p>My DAO Class:</p>
  
  <pre><code>@SuppressWarnings("unchecked")
  public int getRowCount(Map&lt;String, Object&gt; searchParam) throws DAOReadException {
      List&lt;Client&gt; clientRow = null;
      try {
          Criteria criteria = Criteria.forClass(Client.class);
          //set criteria search
          for (String key : searchParam.keySet()) {
  
              /*if(key.equals("ClientPK.clientId1")){
                  criteria.add(Restrictions.like("ClientPK.clientId", searchParam.get(key)));
              }*/
              if(key.equals("clientPK.clientId")){
                  criteria.add(Restrictions.eq(key, Integer.parseInt(searchParam.get(key).toString())));
              }
              if(key.equals("clientName")){
                  criteria.add(Restrictions.like(key, searchParam.get(key)));
              }
  
              if(key.equals("status")){
                  criteria.add(Restrictions.eq(key, Short.parseShort(searchParam.get(key).toString())));
              }
  
  
              //Bug# 12544 start
              if(key.equals("orgId"))
              {
                  criteria.add(Restrictions.eq("ClientPK.orgId", searchParam.get(key)));
              }
              //Bug# 12544 End
      }
          criteria.addOrder(Order.desc("createdDate"));
          clientRow = (List&lt;Client&gt;) findByCriteria(criteria);
      }
  
      catch (Exception e) {
          throw new DAOReadException(e);
      }
      int rowCount = 0;
      if (clientRow != null) {
          rowCount = clientRow.size();
      }
  
      return rowCount;
  }
  
  }
  </code></pre>
  
  <p>error is : </p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: org.hibernate.QueryException: could not resolve property: ClientPK of: com.vin.eretail.model.client.Client [select this from com.vin.eretail.model.client.Client as this where this.ClientPK.orgId=? order by this.createdDate desc]</p>
  </blockquote>