title: How to bind query parameters in hibernate if query is dynamic statement?
body: <p>I am having a dynamic query as :</p>
  
  <pre><code>DECLARE @LOERangeMin int =0 ;
         DECLARE @LOERangeMax int = 0;
         DECLARE @CycleStartStatus nvarchar(500) = :param1;
         DECLARE @CycleEndStatus nvarchar(500) = :param2;
         DECLARE @Team nvarchar(100) = NULL;
         DECLARE @ReportStartDate datetime = NULL;
         DECLARE @ReportEndDate datetime = GETDATE();
  
  select min([Cycle Time]) AS AvgMinCycleTime,max([Cycle Time]) AS AvgMaxCycleTime,AVG([Cycle Time]) AS AvgCycleTime
  from EpicTable where EpicStartStatusName = @CycleStartStatus  and EpicEndStatusName = @CycleEndStatus
  </code></pre>
  
  <blockquote>
    <p>I am preparing Query object by passing this query as a string as :</p>
  </blockquote>
  
  <pre><code>Query que = session.createSQLQuery(queryString);
  </code></pre>
  
  <blockquote>
    <p>In this I want to set CycleStartStatus and CycleEndStatus using que.setParameter("param1",CycleStartStatus); and que.setParameter("param2",CycleEndStatus);</p>
  </blockquote>
  
  <p>I tried this way but it is showing "org.hibernate.QueryParameterException: could not locate named parameter [param1]". So can anyone please help me out how can I do this?</p>