title: Why does setParameter not set the parameter?
body: <p>I'm using the following code to (attempt to) query a database:</p>
  
  <pre><code>Query query = session.createQuery("from Trace where service = :service");
  query.setParameter("service", clientRequest[0]);
  </code></pre>
  
  <p>Where clientRequest[0] is from an array of Strings and the service variable is a String in my POJO mapped to a VARCHAR(45) in my MySQL database.</p>
  
  <p>When I run this code, Hibernate shows the executed SQL query as:</p>
  
  <pre><code>Hibernate: select trace0_.traceId as traceId0_, trace0_.service as service0_, trace0_.longitude as longitude0_, trace0_.latitude as latitude0_, trace0_.timestamp as timestamp0_ from trace trace0_ where trace0_.service=?
  </code></pre>
  
  <p>Which leads me to believe that the value of clientRequest[0] is not being set correctly as a parameter.</p>
  
  <p>I have checked that clientRequest[0] contains a valid String, which it does. I've tried other ways of creating a query but none of these have worked, they always show service as '?', while if I use the obvious:</p>
  
  <pre><code>Query query = session.createQuery("from Trace where service = 21");
  </code></pre>
  
  <p>it naturally gives the correct response of </p>
  
  <pre><code>Hibernate: select trace0_.traceId as traceId0_, trace0_.service as service0_, trace0_.longitude as longitude0_, trace0_.latitude as latitude0_, trace0_.timestamp as timestamp0_ from trace trace0_ where trace0_.service=21
  </code></pre>
  
  <p>What might be stopping setParamater from working correctly?</p>