title: Hibernate Column name Parameter Binding
body: <p>I am binding Named Parameters in a HQL statement, but it just doesn't get filled.</p>
  
  <pre><code>//colname = "AdminsInfo.name"; assume it is from method's input
  //colval = input.getName().toString(); // assume it is from method's input
  
  String query = "from AdminsInfo where :coln = :colv";
  Query q = session.createQuery(query);
  q.setParameter("coln",colname);
  q.setParameter("colv",colval);
  
  System.out.println(q.toString());        
  </code></pre>
  
  <p>it outputs something like this which means parameters (coln, colv) are not set and returns 0 records.</p>
  
  <pre><code>QueryImpl(from AdminsInfo where :coln = :colv)
  Hibernate: select adminsinfo0_.Row as Row1_0_, adminsinfo0_.ID as ID2_0_,adminsinfo0_.Name as Name3_0_, ... where ?=?
  </code></pre>
  
  <p>Any help on how to bind column names in HQL statements are appreciated. Thanks. Mahdi.</p>