title: How to write this case statement in query dsl
body: <p>I have a fairly straight forward case statement to write in querydsl:</p>
  
  <p>case when column >= 1 and column &lt; 31 
  then 1 else 0 end</p>
  
  <p>I tried the following approach:</p>
  
  <pre><code>table.column.goe(Expressions.numberTemplate(Long.class,"1")).and(table.column.lt(Expressions.numberTemplate(Long.class, "31"))).when(Expressions.booleanTemplate("true")).then(Expressions.numberTemplate(Long.class, "1")).otherwise(Expressions.numberTemplate(Long.class, "0"))
  </code></pre>
  
  <p>Trouble is, this expression is being interpreted as:</p>
  
  <pre><code>select sum(case when table.column &gt;= 1 and table.column &lt; 31 = true then 1 else 0 end)
  </code></pre>
  
  <p>Is there a way to avoid specifying the when clause or to put the goe and lt expressions inside the when clause?</p>
  
  <p>BTW, Directly specifying numbers doesnt seem to work in case expressions. Need to use Expressions.numberTemplate</p>