title: Casting values in an HQL Query
body: <p>I'm running the following as part of the where clause of an HQL query:</p>
  
  <pre><code>:timeToTopOfList = ((CAST((j.displayed_position - 1) AS FLOAT) / jp.openings_per_month) * 30)
  </code></pre>
  
  <p>When I run it in SQL Management studio it works just fine, but when I run it through eclipse I get the following error:</p>
  
  <blockquote>
    <p>Caused by: java.lang.NullPointerException
    org.hibernate.dialect.function.CastFunction.render(CastFunction.java:55)</p>
  </blockquote>
  
  <p>I'm also using JPA, and according to this <a href="https://stackoverflow.com/a/4791425/573634">answer</a> you cannot convert types if you're using JPA. Is that true?</p>
  
  <p>I really need to divide two int value columns as a float.</p>